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

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -