note 8144 added to array
| From: | mike at newtradesmen dot com | Date: | Tue, 29 Aug 2000 12:48:57 +0000 |
| Subject: | note 8144 added to array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-3581@lists.php.net to get a copy of this message | ||
By the way, calling array() and then adding associative data into the array causes the array to
store garbage data in the array.
function foo(){
$value = "bar";
$arr = array();
$arr["key"] = $value;
foreach(array_keys($arr) as $s)
{
printf($s);
}
}
You might be surprised what you get, I know I was.
http://www.php.net/manual/function.array.php