I'm new to php and not sure why the go-daddy server treats JSON data differently. When I host it locally on my computer in local host, when I want to echo empty JSON array, I simply put [] shown as below. But when I uploaded the code to go-daddy server and try it out it echoed an error, Parse error: syntax error, unexpected '[', expecting ')' in...I'm wondering how can I put the JSON so it can echo [] when needed. Otherwise it will give "null" and when it parse into AS3, it turn into a JSON parse error.
if (!empty($output)){
echo json_encode( $output );}
else{
echo json_encode( [] );
}