note 11826 deleted from function.compact.php by torben
| From: | torben@php.net | Date: | Thu, 08 Mar 2001 20:15:13 +0000 |
| Subject: | note 11826 deleted from function.compact.php by torben | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-12054@lists.php.net to get a copy of this message | ||
It looks like this function is identical to doing this:
Using compact():
----------
$name = "chris";
$array( "joe" => "bob", "this" => "that" )
compact( "name", $array );
----------
Not using compact():
----------
$array[name] = $name;
Or am I missing something? If it is the same, why would you ever use compact()? Except for
possibly adding more than one element to an array at a time?
Chris