|
Posted by Bob Stearns on 07/25/06 23:04
Noodle wrote:
> Bob Stearns wrote:
>
>>Am I conflating PHP with another language (PERL maybe?) or can you do an
>>assignment to $a, $b and $c something like ($a, $b, $c) = $array? The
>>given sytax doesn't work nor does [$a, $b, $c] = $array. This leads me
>>to believe in the conflation theory. If there is a syntax for this,
>>could you please send me a manual reference for it?
>
>
> $array = array($a, $b, $c);
>
> http://www.php.net/manual/en/function.array.php
>
That is the opposite of what I wanted. The correct syntax, as pointed
out by Andy Hassal is:
list($a, $b, $c) = $array;
Navigation:
[Reply to this message]
|