title: How can I force PHP's json_encode integer values to be encoded as String?
body: <p>I'm using PHP v5.6.</p>
  
  <p>As i read that php json_encode function is automatically converting int to string. But not in my case. Json_encode is still return it to int not string.</p>
  
  <p>Like example:</p>
  
  <pre><code>json_encode(['code' =&gt; 200, 'results' =&gt; [id=&gt; 1]]);
  </code></pre>
  
  <p>my expected results is all become a string. but what i get is </p>
  
  <pre><code>{"code":200,"results":{"id": 1}}
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>{"code":"200","results":{"id": "1"}}
  </code></pre>
  
  <p>How can i change all the result become string without using "" for every value?.</p>
  
  <p>NB: results array is based on query. </p>