You are here: Re: Array to simple variables assignment « PHP Programming Language « IT news, forums, messages
Re: Array to simple variables assignment

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация