Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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)