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 another host, when I check the code, I see this error:
Analysis error: syntax error, unexpected '[' in ....
I showed where the code is causing the error.
i also used:
$data[] = (string) $value->attributes()['data'];
(without 0in [])
How can i solve this?
source
share