How can I load static configuration information
- by Goro
In my code, I use JavaScript for UI and PHP for back end. I also use PHP to store application settings and sometimes my UI code needs to access this information. My configuration file looks something like this (config.php):
$resolution_x = 1920;
$resolution_y = 1080;
etc...
When I need to access any of these settings form JavaScript, i simply use
<?php echo ... ?>
to substitute the value directly, but it just doesn't strike me as very robust.
Are they any dangers of doing this that I am not aware of? Is there a better way of doing this?
Thank you,