News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Michael Nitschinger's Blog:
Handling JSON like a boss in PHP
June 07, 2012 @ 09:13:58

Michael Nitschinger has a new post to his blog about JSON handling in PHP and how to work with it "like a boss".

There are already lots of tutorials out there on handling JSON with PHP, but most of them don't go much deeper than throwing an array against json_encode and hoping for the best. This article aims to be a solid introduction into JSON and how to handle it correctly in combination with PHP. Also, readers who don't use PHP as their programming language can benefit from the first part that acts as a general overview on JSON.

He starts with an introduction to JSON - what it is and what a typical structure looks like. He moves into how to encode JSON in PHP using json_encode, showing teh result of encoding things like arrays, strings and associative arrays. He also includes a bit on translating an object and the resulting JSON string. He mentions the options bitmasks, shows how to decode JSON you're given and talks about error handling and testing of the results.

0 comments voice your opinion now!
json handling tutorial introduction


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Understanding Drupal's EntityFieldQuery

Pascal Opitz's Blog: An example of how to use Pimple DI with ZF 1.x

Wojciech Sznapka's Blog: Power of PHP streams decompress gz archives on the fly from remote server

Dhiraj Patra's Blog: Getting Started with iPFaces PHP Mobile Application Framework

Gonzalo Ayuso: Integrating WebSockets with PHP applications. Silex and socket.io playing together.


Community Events

Don't see your event here?
Let us know!


laravel list extension version community release security library framework podcast laravel5 php7 language introduction series interview example voicesoftheelephpant api opinion

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework