You are here: Re: single quotes, double quotes and "undefined index" « PHP Programming Language « IT news, forums, messages
Re: single quotes, double quotes and "undefined index"

Posted by Michael Fesser on 07/15/07 17:35

..oO(Toby A Inkster)

>Michael Fesser wrote:
>
>> print $foo['bar'];
>> print "hello $foo[bar]";
>> print "hello {$foo['bar']}";
>>
>> All correct.
>
>Correct, yes. But the middle example is unwise.
>
>define('bar', 'baz');

Didn't test it, but according to the manual it should work:

| // The following is okay as it's inside a string. Constants are not
| // looked for within strings so no E_NOTICE error here
| print "Hello $arr[fruit]"; // Hello apple

Micha

 

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

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