How can I get string between <title> and </title> ?
For Exam: $S="<html> this is the <title>TITLE HERE</TITLE> ok </HTML>";
I want to echo "TITLE HERE" only.
<? $array_one=explode('<title>',$a); $array_two=explode('</title>',$array_one[1]); $a=$array_two[0]; ?>
hth Rob
Heres alternative way. I quess its a matter of taste which to use 😉
$s="<html> this is the <title>TITLE HERE</TITLE> ok </HTML>"; preg_match("/<title>(.*)<\/title>/i",$s,$out); print $out[1];