You are here: Re: $request problem « PHP Programming Language « IT news, forums, messages
Re: $request problem

Posted by Norman Peelman on 03/13/06 00:32

"Richard Levasseur" <richardlev@gmail.com> wrote in message
news:1142199015.476842.320290@i40g2000cwc.googlegroups.com...
> define('key', 'foobar', false);
> $a = array('key'=>'value');
> echo "$a[key]<br>";
> echo "{$a[key]}<br>";
> echo "{$a['key']}<br>";
>
> output:
> value
> Errno: 8, Undefined index: foobar
> value
>
> It would seem constants are only expanded if they're in {}, and are
> treated like strings otherwise. I wonder when this was changed, or if
> its unintentional?
>

Interesting enough that in all actuality, you don't need to use curly
braces unless you are dealing with multi-dimensional arrays...

Norm


--
FREE Avatar hosting at www.easyavatar.com

 

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

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