note 69003 added to function.get-meta-tags
| From: | roganty at gmail dot com | Date: | Sat, 19 Aug 2006 10:33:55 +0000 |
| Subject: | note 69003 added to function.get-meta-tags | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116065@lists.php.net to get a copy of this message | ||
This is a slight amendment to jimmyxx at gmail dot com function
I tried using the regex displayed in his code, and php threw up a couple of errors
Below is the correct regular expression that works
(Please note that I had to split the regex into strings because php.net was complaining about the
line being to long)
<?php
preg_match_all(
"|<meta[^>]+name=\"([^\"]*)\"[^>]" .
"+content=\"([^\"]*)\"[^>]+>|i",
$html, $out,PREG_PATTERN_ORDER);
?>
The problem was due to the quotes being incorrectly escaped.
I hope this helps anyone who has been having problems with his code
----
Server IP: 83.138.144.80
Probable Submitter: 82.33.95.88
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.get-meta-tags.php
Edit -- https://master.php.net/note/edit/69003
Del: integrated -- https://master.php.net/note/delete/69003/integrated
Del: useless -- https://master.php.net/note/delete/69003/useless
Del: bad code -- https://master.php.net/note/delete/69003/bad+code
Del: spam -- https://master.php.net/note/delete/69003/spam
Del: non-english -- https://master.php.net/note/delete/69003/non-english
Del: in docs -- https://master.php.net/note/delete/69003/in+docs
Del: other reasons-- https://master.php.net/note/delete/69003
Reject -- https://master.php.net/note/reject/69003
Search -- https://master.php.net/manage/user-notes.php