That’s called array dereferencing and only works in PHP 5.4+. You’re probably running PHP 5.3.x wherever you are getting that error.
More Related Contents:
- Split a comma-delimited string into an array?
- Convert backslash-delimited string into an associative array
- Convert a comma-delimited string into array of integers?
- PHP: Split string into array, like explode with no delimiter
- Explode string into array with no empty elements?
- Add a prefix to each item of a PHP array
- Split a string with two delimiters into two arrays (explode twice)
- Is there an equivalent in C++ of PHP’s explode() function? [duplicate]
- PHP multidimensional array search by value
- How to sum all column values in multi-dimensional array?
- How to convert JSON string to array
- Modify array values in foreach loop
- Build a tree from a flat array in PHP
- Implode an array with “, ” and add “and ” before the last item
- PHP sort array by two field values [duplicate]
- Cartesian Product of N arrays
- Get difference between associative rows of two 2-dimensional arrays
- Foreach loop inside array
- Create new variables from array keys in PHP
- Sort an array by a child array’s value in PHP
- Convert flat array to the multi-dimensional
- CSV to Associative Array
- How to pass an array via $_GET in php?
- How to create an empty array in PHP with predefined size?
- Move an array element to a new index in PHP
- Convert PHP array string into an array
- Push item to associative array in PHP
- PHP Spread Syntax in Array Declaration
- PHP – How to send an array to another page?
- Implementing a simple lookup array