Google php substring12/31/2023 ![]() ![]() You don't need to use multiple characters like I did, but make sure you have enough characters so it doesn't capture something else in the string. Then figure out where each delimiter starts and ends. You can also set them programmatically if you wish. $width = substr($imageURL, $strPosStart, $strPosEnd) īasically, define your string delimiters. $height = substr($imageURL, $strPosStart, $strPosEnd) $strPosEnd = strpos($imageURL, $secondDelimiter)-$strPosStart $strPosStart = strpos($imageURL, $firstDelimiter)+3 Here is working code that I used to find the height and width of an image using delimiters, strpos, strlen, and substr. Some of the answers related to strpos, strlen, and using delimiters are wrong. Do check out our services.There's a lot of good answers here. We work with skilled PHP developers to build amazing products.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |