|
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]
|