$amp_pos) { //is a HTML entity, try to remove $tmp = substr($str, 0, $amp_pos); $tmp = $tmp. substr($str, $semi_pos + 1, strlen($str)); $str = $tmp; //Has another entity in it? if(substr_count($str, '&') && substr_count($str, ';')) $str = remEntities($tmp); } } return $str; } ?>