Re: Check HTML style sheet?

From: Date: Mon, 23 Oct 2006 23:29:11 +0000
Subject: Re: Check HTML style sheet?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-243535@lists.php.net to get a copy of this message
On Fri, October 20, 2006 3:20 am, Marc Roberts wrote: > Is it possible to use php to check that the .css file in the html of a > web page is the correct one e.g. check if the file included in the > html > is new.css. > > I think I will have to write a regex but if anyone has any ideas (or > already has a regex to do this), it would be much appreciated. Depends how fancy you want to get... $html = file_get_contents('http://php.net/'); if (strstr($html, ' <style type="text/css" media="all"> @import url("http://static.php.net/www.php.net/styles/site.css"); @import url("http://static.php.net/www.php.net/styles/phpnet.css"); </style>')) echo "Yup, it's got that CSS in there<br />\n"; else echo "Nope, they changed their CSS<br />\n"; -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#243535) next »