|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-02-23 02:52 UTC] sniper@php.net
[2004-01-02 01:27 UTC] eagleprof at yahoo dot com dot au
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 17:00:01 2025 UTC |
The following code gives me an error message of: Wrong value for parameter 4 in call to preg_match_all() ... if I replace the PREG_OFFSET_CAPTURE with either PREG_OFFSET_CAPTURE | PREG_SET_ORDER or PREG_OFFSET_CAPTURE | PREG_PATTERN_ORDER then it works as advertised. This contradicts the documentation statement: If no order flag is given, PREG_PATTERN_ORDER is assumed $page = "<html><head></head><body><form>" . "<input onClick='alert(\"Hi Mom\")' " . "value='Click me'>" . "<input onClick='alert(\"Hi Dad\")' " . "value=\"Dad's button\">" . "</form></body></html>"; $regexp = "/<input[^>]*(value=[^>]*)>/"; if (!preg_match_all($regexp, $page, $mtch, PREG_OFFSET_CAPTURE)) print "<br>Could not match"; else print "<br>Found matches"; This is on my PHP 4.3.0 / Apache 2.0.43 / Win 2K Pro system Csaba Gabor from New York