note 69441 deleted from function.preg-replace by colder
| From: | colder@php.net | Date: | Mon, 18 Jun 2007 20:03:46 +0000 |
| Subject: | note 69441 deleted from function.preg-replace by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127703@lists.php.net to get a copy of this message | ||
Note Submitter:
----
Note that it is important for the $count parameter to be initialized with "some" value (it
does'nt matter what value or data type you choose).
Otherwise preg_replace() will leave $count untouched.
See this example:
preg_replace('/a/', 't', 'x', -1, $test);
var_dump($test);
Will output NULL.
While this:
$test = 'foo';
preg_replace('/a/', 't', 'x', -1, $test);
var_dump($test);
Will output int(0) as you may have expected.