Re: Multi dimensional array

From: Date: Mon, 03 Aug 2015 07:46:27 +0000
Subject: Re: Multi dimensional array
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-325027@lists.php.net to get a copy of this message
On 3-8-2015 7:22, Ashley Sheridan wrote:
The main thing I think you missed was that array constructs use () and not [] in their creation, which you were using in both of your arrays, that way is a little more how Javascript does it.
That was actually changed in PHP 5.4. There are now 2 ways of creating a new array; - using array() - using [] (which is just a shortcut) So basically $foo = array('a'=>1, 'b'=>2); is equivalent to $foo = ['a'=>1, 'b'=>2]; More info: http://php.net/manual/en/language.types.array.php#language.types.array.syntax - Tul --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

« previous php.general (#325027) next »