Hey guys i have the following code and i need to be able to look through a section of html and pick out all the elements that have the classname cmsedit. The code below does that however if the element has new lines or tabs in it ect the the preg_match_all doesnt work
Help ?
function FindEdits($text, $regex"){ $EditArray = array(); preg_match_all($regex, $text, $result, PREG_PATTERN_ORDER); for ($i = 0; $i < count($result[0]); $i++) { $EditArray[] = array($type,$result[0][$i]); } return $EditArray; }
FindEdits($HtmlContent,"|<h1(.*?)class=\"(.*?)cmsedit(.*?)\"(.*?)>(.*?)</h1>|");