title: json_encode function reads zero from volley but correct from Android Studio
body: <p>I have a php script within which I am checking the number of unpaid tickets belonging to a user. When I call the script on a web browser and pass the user id to it I get the expected response i.e -> <code>["unpaid_tickets","5","success"]</code>.<br>However when I call the same script from an Android application via <code>volley</code> library's <code>StringRequest</code> or <code>JsonArrayRequest</code> I keep getting zero for the value of the number of tickets despite using the same user id. response -> <code>["unpaid_tickets","0","success"]</code>.<br>
  How can I rectify this issue? I have tried adding the parameter to the <code>json_encode()</code>  function such as <code>JSON_NUMERIC_CHECK</code> but to no avail. Any help will be appreciated.
  <br><br>
  PHP Script:<br></p>
  
  <pre><code>    $userid = $_GET['userid'];
  
  $conn = mysqli_connect("localhost",$username,$password,$database) or die('Cannot connect to database');
  
  $sql = "SELECT COUNT(*) AS unpaid_tickets FROM tbl_tickets WHERE userid ='$userid' AND pay_status ='reserved'";
  
  $result = mysqli_query($conn,$sql) or die('Cannot execute query: '.mysqli_error($conn));
  
  
  if($result){
      $row=mysqli_fetch_row($result);
      $tickets = $row[0];
  
      echo json_encode(array('unpaid_tickets',$tickets,'success'));
     // echo $tickets;
  
  }else{
      echo json_encode(array('unpaid_tickets','0-0'));
  }
  </code></pre>
  
  <p><br>
  Android Code:
  <br></p>
  
  <pre><code>            JsonArrayRequest request = new JsonArrayRequest(Request.Method.GET, AppController.getInstance().getURL(AppConst.TAG_URL_CHECK_UNPAID_TICKETS).equals("") ? AppConst.URL_CHECK_UNPAID_TICKETS : AppController.getInstance().getURL(AppConst.TAG_URL_CHECK_UNPAID_TICKETS), null, new Response.Listener&lt;JSONArray&gt;() {
              @Override
              public void onResponse(JSONArray response) {
                  Log.i(TAG,"user id -&gt; "+AppController.getInstance().getPrefManager().getUserId());
                  Log.w(TAG,"ticket check response -&gt; "+response.toString());
              }
          }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  Log.e(TAG,"processUnpaidTicket() volley -&gt; "+error.toString());
              }
          }){
              @Override
              protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
                  Map&lt;String,String&gt; params = new HashMap&lt;&gt;();
                  params.put(AppConst.TAG_USER_ID, AppController.getInstance().getPrefManager().getUserId());//add user id to request
                  return params;
              }
          };
  </code></pre>