Tricky preg_replace_callback function here - I am admittedly not great at PRCE expressions.
I am trying to extract all img src values from a string of HTML, save the img src values to an array, and additionally replace the img src path to a local path (not a remote path). Ie I might have, surrounded by a lot of other HTML:
img src='http://www.mysite.com/folder/subfolder/images/myimage.png'
And I would want to extract myimage.png to an array, and additionally change the src to:
src='images/myimage.png'
Can that be done?
Thanks