...

View Full Version : JSON code structure



Bobafart
02-17-2008, 02:48 AM
I finally decided to convert from XML to JSON for my data interchange.

I started reading about JSON tonight.

I am unable to find decent tutorials on how the .php script should look when trying to output/create data JSON format

say I have a mySQL table and I want to output some of the data in my table into the JSON format

how would my PHP script look like?

Bobafart
02-17-2008, 02:51 AM
also my host only has PHP Version 5.0.4

I understand JSON is incorporated into 5.2

how can I use JSON with ver 5.0.4?

thanks

Ultragames
02-17-2008, 06:57 AM
You'll want to check out the PEAR extension for JSON.
This (http://extjs.com/tutorial/creating-json-data-php) should tell you what you need to know.

Why did you choose JSON over XML?

Bobafart
02-17-2008, 02:14 PM
head to head performance seems to show JSON parsing as being more efficient than XML

hence, faster apps

oesxyl
02-17-2008, 03:07 PM
head to head performance seems to show JSON parsing as being more efficient than XML

hence, faster apps

xml give flexibility, in my opinion you may look for a compromise.

this could be usefull for json:

http://www.json.org/

there is also a list of parser on the bottom of the page.
Take a look also for yaml

http://www.yaml.org/

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum