note 103721 added to function.list
| From: | cHao at osu1 dot php dot net | Date: | Fri, 29 Apr 2011 16:44:14 +0000 |
| Subject: | note 103721 added to function.list | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179282@lists.php.net to get a copy of this message | ||
Re: lili at nikha dot org: PHP already has a function to extract elements from an array into
variables with the same name. It's called "extract".
<?php
$petnames = array();
$petnames['dog'] = 'Paul';
$petnames['cat'] = 'Lili';
extract($petnames);
echo 'my pets are '.$dog.' and '.$cat;
?>
----
Server IP: 69.147.83.197
Probable Submitter: 71.246.145.180
----
Manual Page -- http://www.php.net/manual/en/function.list.php
Edit -- https://master.php.net/note/edit/103721
Del: integrated -- https://master.php.net/note/delete/103721/integrated
Del: useless -- https://master.php.net/note/delete/103721/useless
Del: bad code -- https://master.php.net/note/delete/103721/bad+code
Del: spam -- https://master.php.net/note/delete/103721/spam
Del: non-english -- https://master.php.net/note/delete/103721/non-english
Del: in docs -- https://master.php.net/note/delete/103721/in+docs
Del: other reasons-- https://master.php.net/note/delete/103721
Reject -- https://master.php.net/note/reject/103721
Search -- https://master.php.net/manage/user-notes.php