note 46740 added to function.array
| From: | brett at cusaac dot com | Date: | Thu, 21 Oct 2004 20:33:00 +0000 |
| Subject: | note 46740 added to function.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78905@lists.php.net to get a copy of this message | ||
You can also create arrays without using array() as in the following:
<?php
$myarray[0][0] = 1;
$myarray[0][1] = 2;
$myarray[0][2] = 3;
$myarray[1][0] = 10;
$myarray[1][1] = 11;
$myarray[1][2] = 12;
for ($i = 0; $i < count($myarray); $i++) {
for ($n = 0; $n < count($myarray[$i]); $n++) {
echo $i . "," . $n . ": ";
echo $myarray[$i][$n];
echo "\n\n";
}
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46740
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46740&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46740&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46740&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46740&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46740&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46740&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46740&report=yes
Search -- http://master.php.net/manage/user-notes.php