title: PHP array not converting to JSON using json_encode
body: <p>I am trying to convert my <code>$response</code> array to JSON but it is not converting. I tried to echo the values in the array to be sure that it is not null. </p>
  
  <pre><code>    if($row['count(*)']&gt;0)
      {
          $sql="select * from guide_city_detail where CITY='$place'";
          $result = $conn-&gt;query($sql);
          $row = $result1-&gt;fetch_assoc();
          $row = array_map('utf8_encode', $row);
          $response['status']=1;
          $response['city']=$row['CITY'];
          $response['state']=$row['STATE'];
          $response['country']=$row['COUNTRY'];
          $response['heads']=$row['HEADS'];
          $response['col1']=$row['COL1'];
          $response['col2']=$row['COL2'];
          $response['col3']=$row['COL3'];
          $response['col4']=$row['COL4'];
          $response['col5']=$row['COL5'];
          $response['col6']=$row['COL6'];
          $response['col7']=$row['COL7'];
          $response['col8']=$row['COL8'];
          $response['col9']=$row['COL9'];
          //echo $response['country'];
      }
      else
      {
          $response['status']=0;// save the entry for future references
          $output = shell_exec("java -cp \".;D:/letsgo/mysql.jar;D:/letsgo/jsoup.jar;\" GeneralPopulate $place 2&gt;&amp;1");
          //echo "$output";
      }
      $res=json_encode($response);
      echo $res;
  }
  </code></pre>