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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -