I am making a method to resize an image from wordpress.
I need to remove a value from a string eg:
<img src="/path/img.jpg" width="600" height="400" />
I need to remove the 600 and 400 values and place into my function like so:
resiseImg($width, $height);
I will then return the width and height and perform a str_replace
. However I am unsure as to how I will actually take them out of the string, I guess an ugly way could be to perform some form of binary search algorithm of the string, which I really don't want to do unless there is no other option.