Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post

    JSON code structure

    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?

  • #2
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post
    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

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts
    You'll want to check out the PEAR extension for JSON.
    This should tell you what you need to know.

    Why did you choose JSON over XML?
    If I'm postin here, I NEED YOUR HELP!!

  • Users who have thanked Ultragames for this post:

    Bobafart (02-17-2008)

  • #4
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post
    head to head performance seems to show JSON parsing as being more efficient than XML

    hence, faster apps

  • #5
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Bobafart View Post
    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

  • Users who have thanked oesxyl for this post:

    Bobafart (02-17-2008)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •