Regex & PHP - isolate src attribute from img tag -
With PHP, how can I separate the content of src attribute from $ Foo? The end result is just "me"
$ foo = '& lt; Img class = "foo bar test" heading = "test image" src = "http: / /example.com/img/image.jpg" alt = "test image" width = "100" height = "100" /> ; ';
If you do not want to use regex (or any non-standard PHP components) ), A proper solution using the built-in will be as follows:
); $ ImageTags = $ doc- & gt; GetElementsByTagName ('IMG'); Forex Currency ($ imageTags as $ Tag) {echo $ tag-> GetAttribute ('src'); }? & Gt;
Comments
Post a Comment