here is the code and a sample of the tags:
Code: Select all
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>