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
constant.php
"val", "const2" => "val2"); ?>
======================END OF FILE constant.php=======
In php you can access using
$array[""]
In javascript, you can access using
contants.const1, ....