- Re-initialize array, otherwise the example spits out:

Warning: Invalid argument supplied for foreach() in /tmp/foreach-test.php on line 42


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@168562 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Derick Rethans 2004-09-14 08:28:00 +00:00
parent 35f1cd5a99
commit 8838b71ffa

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.107 $ -->
<!-- $Revision: 1.108 $ -->
<chapter id="language.control-structures">
<title>Control Structures</title>
@ -651,7 +651,7 @@ foreach ($a as $k => $v) {
}
/* foreach example 4: multi-dimensional arrays */
$a = array();
$a[0][0] = "a";
$a[0][1] = "b";
$a[1][0] = "y";