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

Posted by ColdShine on 10/04/96 11:42

Anonymous in news:4416CEBE.92F38532@nowhere.invalid wrote:

> ColdShine wrote:
>
>> Here's a quick roundup, if you (or anyone f'wing this thread) still are
>> wondering WHAT is meant WHEN:
>>
>> <?php
>> $arr = array('key' => 'foo');
>> define('key', 'another');
>>
>> echo $arr[key]; // undefined index ('another')
>> echo $arr['key']; // foo
>> echo '$arr[key]'; // $arr[key]
>
> Ok, these results are obvious, IMHO.

I included those for the sake of completeness...


>> echo "$arr[key]"; // foo
>> echo "$arr['key']"; // parse error
>
> But these two are not. For the first case: Where in the manual does it
> state that "$arr[key]" should be evaluated like $arr["key"]? For the
> second: Within double quotes variables should be evaluated, so why
> doesn't $arr['key'] evaluate to foo?

This answers your questions:
http://www.php.net/manual/en/language.types.string.php#AEN3054

If you could not find this in the manual it's your fault, as it's just
where... you should expect it to be :)


>> This should rule out any misunderstandings.
>
> Yes, it did. But it also brought up two new questions on my part. :-)

....and anyone else's who's not read the manual of course.

--
ColdShine

"Experience is a hard teacher: she gives the test first, the lesson
afterwards." - Vernon Sanders law

 

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

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