RE: [PHP] A problem with associative arrays..

From: Date: Wed, 26 Jul 2000 20:41:03 +0000
Subject: RE: [PHP] A problem with associative arrays..
Groups: php.general 
Request: Send a blank email to php-general+get-8405@lists.php.net to get a copy of this message
> Ah right. This is a known limitation. Just like you can't do: > $a = 'abc'; > $a[1] = 'def'; > Once $a is defined to be a string, then $a[1] is an offset into that > string array. Woah! PHP can do this? Since what version? As far as I knew, you needed to use substr() to get even 1 character from a string. This is too cool. > > $conf['db'] = "testdb"; > > $conf['db']['host'] = "dbhost"; He's not defining it as a string. He's accessing it as an array. Does it still apply? What if he defined $conf to be an array prior to this? Chris

« previous php.general (#8405) next »