note 76980 added to function.list
| From: | mick at wireframe dot com | Date: | Wed, 08 Aug 2007 19:08:16 +0000 |
| Subject: | note 76980 added to function.list | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129354@lists.php.net to get a copy of this message | ||
It's worth noting that, as expected, list() does not have to have as many variables (and/or
empty skips) as there are elements in the array. PHP will disregard all elements that there are no
variables for. So:
<?php
$Array_Letters = array('A', 'B', 'C', 'D', 'E',
'F');
list($Letter_1, $Letter_2) = $Array_Letters;
echo $Letter_1 . $Letter_2;
?>
Will output: AB
Mick
----
Server IP: 209.41.74.194
Probable Submitter: 64.52.10.140
----
Manual Page -- http://www.php.net/manual/en/function.list.php
Edit -- https://master.php.net/note/edit/76980
Del: integrated -- https://master.php.net/note/delete/76980/integrated
Del: useless -- https://master.php.net/note/delete/76980/useless
Del: bad code -- https://master.php.net/note/delete/76980/bad+code
Del: spam -- https://master.php.net/note/delete/76980/spam
Del: non-english -- https://master.php.net/note/delete/76980/non-english
Del: in docs -- https://master.php.net/note/delete/76980/in+docs
Del: other reasons-- https://master.php.net/note/delete/76980
Reject -- https://master.php.net/note/reject/76980
Search -- https://master.php.net/manage/user-notes.php