note 24330 added to language.variables.variable
| From: | (J. Dyer) | Date: | Tue, 13 Aug 2002 13:32:00 +0000 |
| Subject: | note 24330 added to language.variables.variable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34934@lists.php.net to get a copy of this message | ||
... to continue my previous example of placing dynamically named objects into an array, we can
easily pull everything back out again using a basic array function: foreach.
<?php
//...
foreach($array as $key=>$object){
echo $key." -- ".$object->print_fcn()." <br/>\n";
} // end foreach
?>
Through this, we can pull a dynamically named object out of the array it was stored in without
actually knowing its name.
--
http://www.php.net/manual/en/language.variables.variable.php
http://master.php.net/manage/user-notes.php?action=edit+24330
http://master.php.net/manage/user-notes.php?action=delete+24330
http://master.php.net/manage/user-notes.php?action=reject+24330