Monday, March 19, 2012

Parse JSON in PHP

0
Parsing a string in Json is very easy in PHP. You can parse the Json by using json_decode() function, Below is sample code you can used as reference.

$values='{"id":1,"name":"shahid","lastname":"khan","Website":"http://google.com"} ';

$data=json_decode($values);
print_r($data);
echo $data->name;

No comments :

Post a Comment