You are here: Arrays: $SomeArray{0} vs. $SomeArray[0] « PHP Programming Language « IT news, forums, messages
Arrays: $SomeArray{0} vs. $SomeArray[0]

Posted by Ira Gladnick on 12/01/06 05:36

I have found that in PHP 5, <?php $SomeArray{0} = $somevalue ?> (note
the squigly braces) appears to be functionally equivalent to the more
usual <?php $SomeArray[0] = $somevalue ?> (square array brackets).

However, doing $SomeArray{} = $somevalue raises an error.

I can't seem to find any documentation that indicates why you can use
squigly braces in the case where an array index is provided. Was
wondering if someone could explain why they work in that situation, and
possibly provide a reference to this use of squigly braces in the PHP 5
documentation.

(I am a rank PHP newbie, for whatever that's worth..)

 

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

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