Posted by FFMG on 08/02/07 15:48
Hi,
I want to get the <head> code and a 'simple?' solution seems to be
be...
preg_match_all("/<[html]+[^>]*>\s*(.*\s*)<\/html>\s*/i", $html,
$matches, PREG_SET_ORDER);
but I want to make sure that there isn't a better solution to the
problem especially if the head contains invalid code like...
//--
<head>
<meta name="description" content="<head></head>" />
</head>
//--
unfortunately this is my html code so I cannot ignore invalid <head>
like the one above.
So...
How can I change my regex to ignore head tags inside double or single
quotes?
How can I look for multiple line code inside the head.
Any suggestions?
FFMG
--
'webmaster forum' (http://www.httppoint.com) | 'Free Blogs'
(http://www.journalhome.com/) | 'webmaster Directory'
(http://www.webhostshunter.com/)
'Recreation Vehicle insurance'
(http://www.insurance-owl.com/other/car_rec.php) | 'Free URL
redirection service' (http://urlkick.com/)
------------------------------------------------------------------------
FFMG's Profile: http://www.httppoint.com/member.php?userid=580
View this thread: http://www.httppoint.com/showthread.php?t=19012
Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).
[Back to original message]
|