String:
$string ="<img src=\"\" alt=\"\" />Sunny, and 30 ° F. For more details?";
-need the img code to be in $img
-then before the comma i need to be in $forecast
-after the comma drop everything but the temp into $temp
-everything after that discard
i was thinking of:
$string = explode($string,'.'); // gets rid of the end bits
$string = explode($string[0],","); //gets the img and forecast sep from temp
preg_match("/(0-9)[2]/",$strong[1],$temp); //gets just temp
preg_match("/<(.*)>/",$string[0],$img); //gets the img code
$string = explode($string[0],">"); //gets the forcast on its own
$forecast = $string[1];
but thats pretty sloppy and inefficient