how to write the server side in php if i am using the json on client side of the iphone
i want to make my server side in php. after writing the code in php can i directly use json to parse it of or something other required on the server side with php.
can you give me some example of it, h开发者_如何学运维ow to do this on server side if i want to use json of my client side.
You can't use JSON to parse things, JSON is the data format.
You can use a JSON parser and a JSON serializer at both ends (i.e. in client side JS and server side PHP).
http://json.org/ has links to parsers and serializers in various languages near the bottom, they have documentation which usually includes examples.
JSON is a very simple and straight-forward format, so in case your data model is also simple, you could just use plain echo() or printf() statements on your server to generate the JSON output.
You probably mean that you want to encode something on the server side as JSON. Take a look at json_encode: http://php.net/manual/en/function.json-encode.php
精彩评论