Re: Illegal string offset error in array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Findeisen wrote:
Hello all,

sorry if this has been asked allready but i didn't find any usefull information in the web.

Why is this function not working in PHP5?
[snip]
/*
* This line does not work in PHP5 cause off an illegal string offset in an array ERROR
*/
$arrAvailableContent[$i]['submenu'][$n]['file'] = $subfile;
[snip]
Can someone help?

You can't access string offsets with square brackets [] in PHP5. You need to use curly braces {} instead.


Square brackets [] for arrays, curly braces {} for string offsets.

--
Jasper Bryant-Greene
Cabbage Promotions
www:   www.cabbage.co.nz
email: jasper@xxxxxxxxxxxxx
phone: 021 232 3303

public key:  Jasper Bryant-Greene <jasper@xxxxxxxxxxxxx> keyID 0E6CDFC5
fingerprint: 2313 5641 F8F6 5606 8844 49C0 1D6B 2924 0E6C DFC5

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux