I am using this code below :
$data = array();
$value = reset($value);
$data[0] = (string) $value->attributes()['data'];
------^
I have no problem in localhost, but in other host, when i check the code, i see this error :
Parse error: syntax error, unexpected '[' in ....
I have shown where the code causes error .
i have also used :
$data[] = (string) $value->attributes()['data'];
(without 0
in []
)
How can i solve it ?