Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

JSON with PHP

I want to learn how to use JSON with PHP,and I have checked http://www.php.net/manual/en/book.json.php and this manual is great but I am looking for a tutorial with real life example,how can I use JSON in php. Can anyone give me a tutorial link for this.

Thanks in advance :-)

3 Answers

Patrik Balogh
Patrik Balogh
47,986 Points

Use this functions: http://www.php.net/manual/en/ref.json.php Mainly: json_decode, json_encode

.......you will get JSON data in an indexed array......

I figured this out a while ago,anyway thanks your answer.

Patrik Balogh
Patrik Balogh
47,986 Points

Yeah, but JSON is so easy in PHP......so if you understand JSON format and you handle PHP arrays.....you'll win the match. ;D)