How to create Json Array - php -
how create json array , call android project :
{ "error_two":false", "getuser":true, "call": [ { "id": "1", "fname": "ex", "lname": "ex", "username": "ex", "gender" : "ex", } ] }
error_two , getusers it's request login , want send project
my php :
if ($getuser !== false) { $json["error_two"] = false; foreach($db->get("users",array('id', 'not like', $id))->results() $u){ $user = new user( $u->id ); $json = array( 'error_two' => false, 'getuser' => $getuser, 'user_id' => $user->data()->id, 'fname' => $user->data()->fname, 'lname' => $user->data()->lname, 'username' => $user->data()->username, 'gender' => $user->data()->gender ); echo "{\"call_two\":[".json_encode($json)."],}"; } }
Comments
Post a Comment