Question : PHP/RegEx to Extract Data from img tag

I have some code that is looping through some copy on my site.

I'm looking to do something like this:
//Check if the line contains <img src="">
if(isImage($lineToCheck)) {
   //If it is, extract alt text, and img src.
}

It checks to see if $lineToCheck contains an img tag, and if it does, it pulls out the Alt text, and the img src.

Answer : PHP/RegEx to Extract Data from img tag

Found a solution trough the forum from Shadow Protect
Random Solutions  
 
programming4us programming4us