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.
See results based on different PHP versions
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?
- Explode string into array with no empty elements?
- Add a prefix to each item of a PHP array
- PHP: Split string into array, like explode with no delimiter
- How to explode only on the last occurring delimiter?
- Split a string with two delimiters into two arrays (explode twice)
- PHP ellipsis using substr and concatenation
- How to remove duplicate values from an array in PHP
- Strange behavior Of foreach
- How to filter an array by a condition
- How to echo or print an array in PHP?
- Sorting an associative array in PHP [duplicate]
- Build a tree from a flat array in PHP
- PHP: merge two arrays while keeping keys instead of reindexing?
- PHP list all files in directory [duplicate]
- PHP reindex array? [duplicate]
- Preserve key order (stable sort) when sorting with PHP’s uasort
- Can you store a function in a PHP array?
- php var_dump() vs print_r()
- Return index of highest value in an array
- Converting a SimpleXML Object to an Array [closed]
- PHP append one array to another (not array_push or +)
- How to remove a variable from a PHP session array
- How to count non-empty entries in a PHP array?
- MySQLi Bind Param with an array for IN [duplicate]
- Get date range between two dates excluding weekends
- Compare multidimensional arrays in PHP
- Fastest way of deleting a value in a comma separated list
- Is there a way to fetch associative array grouped by the values of a specified column with PDO?
- PHP hierarchical array – Parents and childs
- Sort a flat, associative array by numeric values, then by non-numeric keys
- PHP compare array
- Is there a way to loop through a multidimensional array without knowing it’s depth?
- php getting unique values of a multidimensional array [duplicate]
- Group rows in an associative array of associative arrays by column value and preserve the original first level keys
- PHP combine two associative arrays into one array
- Use json_decode() to create array insead of an object
- Merge two 2d arrays by shared column value
- Count “truthy” values in a 2d array
- PHP – count specific array values
- Using usort in php with a class private function
- Converting an array from one to multi-dimensional based on parent ID values
- How to create an empty array in PHP with predefined size?
- Fatal error: Uncaught Error: Cannot use a scalar as an array warning
- PHP object like array
- What is the difference between array_udiff_assoc() and array_diff_uassoc()?
- Concatenate values of n arrays in php
- PHP get previous array element knowing current array key