note 7229 deleted from function.each by felipe
| From: | felipe@php.net | Date: | Sun, 20 Jul 2008 23:48:58 +0000 |
| Subject: | note 7229 deleted from function.each by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142369@lists.php.net to get a copy of this message | ||
Note Submitter: aryn at aryn dot nu
----
one way to get variables out of an array dynamically, while skipping the keys is this:
while( list($key,$value)=each($foo)) {
if (!is_int($key)) {
echo "$"."$key: $value\n";
$$key = $value;
}
}
(the echo line is just for displaying what is variables are getting set; ie: not needed.)