Skip to content
Advertisement

Best way to write arrays to a file? [closed]

I want to avoid writing to DB and use constants/array for lang files etc.

i.e:

JavaScript

and be able to edit it from the back office. (then instead of fetching it from the poor db, i would just use $lang[‘hello’]..).

what are you suggesting for the best and efficient way to pull it of?

Advertisement

Answer

Definitely JSON

To save it :

JavaScript

To get it back :

JavaScript

As simple as that !

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement