A problem with associative arrays..

From: Date: Wed, 26 Jul 2000 20:06:33 +0000
Subject: A problem with associative arrays..
Groups: php.general 
Request: Send a blank email to php-general+get-8395@lists.php.net to get a copy of this message
Ok, I have just discovered that I cannot mix 'dimensions' in an associative array. The source I have : <?php $conf[db] = "bazfoobar"; $conf[db][host] = "thishost"; echo "value is: " . $conf[db] . "<br>"; echo "host is: " . $conf[db][host] . "<br>"; $conf[db] = "foobarbaz"; $conf[db][host] = "somehost"; echo "value is now : " . $conf[db] . "<br>"; echo "host is now : " . $conf[db][host] . "<br>"; php?> Generates : value is: tazfoobar host is: t value is now : soobarbaz host is now : s Is this expected behaviour in PHP3? Can I actually do this in PHP4? Do I have to ensure that all of my associative arrays have the exact same dimensions? Suggestions? Hints? Valium? :) TIA.. :) Sincerely, Warren

« previous php.general (#8395) next »