1,234
edits
Changes
no edit summary
PHP doesn't have to generate only HTML. It is quite reasonable to generate JavaScript in PHP as well.
== JSON ==
You can think of JSON is a data structure. It can be modified using native JavaScript methods, and many languages have libraries that allow you to create a JSON string from an object, or even create a native object from a JSON string.
The [http://json.org/ JSON website] has a description/illustration of how you can store strings, numbers, arrays, and associative arrays in JSON.
JSON is a great way to transfer data structures from the server to the client and back. I will show you a real word example of how it is used.
= References =