Changed example #2 in preg_replace() to have the arrays initialized before writing to them.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@292327 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Daniel Egeberg 2009-12-19 12:05:56 +00:00
parent 6bb56ebdc3
commit 1b6cf34f23

View file

@ -214,9 +214,11 @@ April1,2003
<![CDATA[
<?php
$string = 'The quick brown fox jumped over the lazy dog.';
$patterns = array();
$patterns[0] = '/quick/';
$patterns[1] = '/brown/';
$patterns[2] = '/fox/';
$replacements = array();
$replacements[2] = 'bear';
$replacements[1] = 'black';
$replacements[0] = 'slow';