note 18562 added to function.array-push
| From: | linuxbaby at yahoo dot com | Date: | Mon, 28 Jan 2002 09:13:54 +0000 |
| Subject: | note 18562 added to function.array-push | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-25890@lists.php.net to get a copy of this message | ||
Interesting! Maybe $a[]=$b is NOT the same as array_push($a, $b) - when you want the VALUE of an
array to also be an array.
$a = array();
$b = array("one","example","array");
$c = array("another","silly","test");
$a[] = $b; /* ERROR */
$a[] = $c; /* ERROR */
but...
array_push($a, $b); /* WORKS */
array_push($a, $c); /* WORKS */
--
http://www.php.net/manual/en/function.array-push.php
http://master.php.net/manage/user-notes.php?action=edit+18562
http://master.php.net/manage/user-notes.php?action=delete+18562
http://master.php.net/manage/user-notes.php?action=reject+18562