note 20225 added to function.get-meta-tags

From: Date: Tue, 26 Mar 2002 23:49:47 +0000
Subject: note 20225 added to function.get-meta-tags
Groups: php.notes 
Request: Send a blank email to php-notes+get-28252@lists.php.net to get a copy of this message
------------------------------ PHP Version 4.0.2 on Sun Solaris running Apache 1.3.12 ------------------------------ If I use ' instead of " in meta tags OR don't use either for the meta tag names, I get the following warnings: Example: ------------------------------ <HTML> <HEAD> <TITLE>Space Monitor</TITLE> <META NAME=Generator CONTENT="Perl 5.0"> <META NAME=Author CONTENT="Joe Weigel"> <META NAME=Keywords CONTENT="monitor, space, free, used, capacity"> <META NAME=Description CONTENT="Results of the Space-Monitor agent"> <META HTTP-EQUIV=refresh CONTENT=300> <LINK REL=stylesheet HREF=/default.css TYPE=text/css> </HEAD> Produces: ------------------------------ Warning: get_meta_tags("http://148.172.1.194/utils/space-monitor.html") - Error 0 in /webdocs/htdocs/index.php on line 439 Warning: file("http://148.172.1.194/utils/space-monitor.html") - Error 0 in /webdocs/htdocs/index.php on line 199 ...and fails to extract the information. Fixed by inserting " for all meta tag name and values -- http://www.php.net/manual/en/function.get-meta-tags.php http://master.php.net/manage/user-notes.php?action=edit+20225 http://master.php.net/manage/user-notes.php?action=delete+20225 http://master.php.net/manage/user-notes.php?action=reject+20225

« previous php.notes (#28252) next »