By drupalzack on
I have an html string like this:
<img src="/files/vile.jpg" width="500" height="367" alt="vile.jpg" />
What is the best way to extract only the path: /files/vile.jpg from the above string? I'm not too familiar with regex, any help is greatly appreciated!
Comments
I would strpos on src and on
I would strpos on src and on jpg and then return the string in between.
try this regular expression
You could try something like this
hope this helps
Thanks prakashp!
Thanks prakashp!
Suggestion
My suggestion:
Accepts: "path", 'path', path.
Thank you! this improvement
Thank you! this improvement is even better!