tags:

views:

86

answers:

3

Anyone knows where i can get good introduction info on json in relation to php

+7  A: 

You can check the PHP manual for JSON functions: json_encode and json_decode

You can also take a look at json.org for the JSON spec.

In brief, JSON is a data format that can be read natively by Javascript, which makes it very fast and convenient for doing AJAX requests or generally passing information from server-side scripts to Javascript.

Greg
thnx, that was usefull
the_forgotten_guru
It depends on the JavaScript implementation if it can be read natively.
Gumbo
I think its important to say that almost the languages now accept json; Is closer to become an official array structure cross-language ;)
DaNieL
always wondered why json was preferred. thanks!
centr0
A: 

there's not much to be introduced to. try var_dump(json_encode($x)); and var_dump(json_decode(json_encode($x))); for different values (and types) of $x, and you know basically everything there is to it.

just somebody
A: 

IMHO, you need a good introduction to JavaScript before you can use JSON with your PHP application. Once you master JavaScript {Objects}, [Arrays] and (Functions), all of the brackets used inside JSON will start to make sense.

Salman A