bradgrafelman;10988907 wrote:Perhaps you're viewing this output in a web browser (which is going to render that output as HTML, naturally)?
Thats correct... But the problem is more complex than that. I'm trying to do this:
I'm making a sort of a regex script where I want to get the text between some tags using this function:
function get_string_between($string, $start, $end){
$string = " ".$string;
$ini = str_get_html($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}
$regstart = '<div>';
$regend = '</div>';
$txt = '<div>This is a test</div>';
$content = get_string_between($txt, $regstart, $regend);
echo 'Content: '.$content;
I dont get the regstart and regend sent correctly? Please help...