Please help me figure out this error:
Parse error: syntax error, unexpected ‘[‘ in
/var/www/user/data/www/sayt.ru/index.php on line 33
Here is line 33:
if (array_key_exists ("p", $ _GET) & amp; & amp; in_array ($ _ GET ["p"] , ["admin", "password-reset"])) {
PHP version 5.3.28
Answer 1, authority 100%
There is no short syntax for arrays in PHP 5.3.x. This means that the construction
["admin", "password-reset"]
not valid.
Use
instead
array ("admin", "password-reset")
For reference:
An abbreviated syntax for defining arrays appeared only in PHP 5.4.0