Hi all, i am using preg_match_all to the ids and contents within a custom html tag, it all works fine if the contents within the tags are all in one line, but if they go over multiple lines, it doesn't match it.
here is the code and a sample of the tags:
function getTranslationID($string){
$pattern = "/<translate RID=\"(.*?)\">(.*?)<\/translate>/";
preg_match_all($pattern,$string,$matches);
$matched['id'] = $matches[1];
$matched['contents'] = $matches[2];
if(!empty($matches[1])){
return $matched;
} else {
return NULL;
}
}
// a sample of html in php to match
<tranlslate RID="002"> contents..... ..... ..... ... whwhhw.....
;;;;;......................
................contents</translate>
//it works fine with:
<translate RID="002">contents ... ..... ..... ..... ...</translate>
can anyone tell me what im doing wrong? thanks......