note 14085 added to function.extract.php
| From: | carsten at sarum dot dk | Date: | Mon, 16 Jul 2001 20:33:50 +0000 |
| Subject: | note 14085 added to function.extract.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15449@lists.php.net to get a copy of this message | ||
Note, that if extract() is used inside a function, the extracted global variables are automatically
available inside the function without the need for the "global" statement.
Example
$arr = array("fruit" => "apple", "cake" =>
"cheesecake");
function foo() {
global $arr;
extract($arr);
echo $fruit; // This will produce "apple";
}
http://www.php.net/manual/en/function.extract.php