note 32170 added to function.preg-match-all
| From: | ben at slax0rnet dot com | Date: | Mon, 19 May 2003 14:29:24 +0000 |
| Subject: | note 32170 added to function.preg-match-all | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-48592@lists.php.net to get a copy of this message | ||
found a possible error in the above documentation:
the flag PREG_OFFSET_CAPTURE does not appear to work in PHP 4.3.0 as stated by the manual with
regards to preg_match_all().
Under PHP 4.3.0:
$str="<div>test</div><div>test2</div>";
preg_match_all("/(<div>)/i", $str, $starts, PREG_OFFSET_CAPTURE);
will throw the error:
Warning: Wrong value for parameter 4 in call to preg_match_all() in /path/to/script.php on line 2
preg_match() appears to work correctly using the same code, but without the benefits inherant in
preg_match()
----
Manual Page -- http://www.php.net/manual/en/function.preg-match-all.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32170
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32170&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32170&report=yes