Possible Duplicate:
json_decode returns NULL after webservice call
I am developing a REST service oriented App, in that on the place of login , i post the username and password it returns a json of following
{"id":"4","username":"sam","redirect":"clients/home"}
after that when i try to json_decode(), it showing NULL, can you tell me what is the problem my server is PHP 5.2.12 and it support JSON_Decode.
function login()
{
$result=$this->rest->request("http://localhost/account/users/login","POST");
$qry['result']=json_decode($result);
var_dump($qry['result']);
foreach($qry as $result)
{
$this->session->set_userdata('id',$result->id);
$this->session->set_userdata('username',$result->username);
redirect($result->redirect);
}
}