Following []
is supported in PHP >= 5.4:
['name' => 'test', 'id' => 'theID']
This is a short syntax only and in PHP < 5.4 it won’t work.
More Related Contents:
- PHP syntax for dereferencing function result
- Shorthand for arrays: is there a literal syntax like {} or []?
- PHP syntax for dereferencing function result
- How can I add a condition inside a php array?
- Removing array of arrays for certain inner values in PHP
- Can't echo items from array
- How to solve PHP error ‘Notice: Array to string conversion in…’
- PHP curly brace syntax for member variable
- Replace keys in an array based on another lookup/mapping array
- Strange behavior of foreach when using reference: foreach ($a as &$v) { … }
- PHP: Check if an array contains all array values from another array
- php implode (101) with quotes
- Combinations, Dispositions and Permutations in PHP
- PHP Add element to every sub array of multi dimension array
- PHP foreach with Nested Array?
- Why are functions and methods in PHP case-insensitive?
- Compare multidimensional arrays in PHP
- PDO fetchAll array to one dimensional
- PHP curly braces in array notation
- Iterating over a complex Associative Array in PHP
- Merging two arrays with the “+” (array union operator) How does it work?
- PHP: Create an array for a range
- Interleaving multiple arrays into a single array
- Easy way to apply a function to an array
- what is a good method to sanitize the whole $_POST array in php? [duplicate]
- foreach with three variables add
- How to iterate through a nested stdClass? [duplicate]
- PHP: Most frequent value in array
- How to get the object or class name?
- Convert delimited string into array key path and assign value