I\'m trying to create a common constants file to share between php and javascript, using JSON to store the constants. But I\'m wondering why pass the JSON from PHP to javasc
The argument to json_encode() should be a PHP data structure, not a string that's already in JSON format. You use this when you want to pass a PHP object to Javascript.