title: How To Keep Leading Zeros Using PHP json_encode()
body: <p>Is there an easy way to keep leading zeros in PHP using <code>json_encode()</code>?  In the example below I need the result to be <code>"columnA":"00123"</code></p>
  
  <pre><code>...pdo query...
  $data = $myQuery-&gt;fetch(PDO::FETCH_ASSOC);
  //trigger_error('columnA: '.$data['columnA']); This reports it correctly: 00123
  echo json_encode($data); //after this call it reports: "columnA":"123"
  </code></pre>
  
  <p>I was using the <code>JSON_NUMERIC_CHECK</code> option because I routinely returns 1s and 0s for true/false so I thought this was causing the zeros to be stripped.  So I removed that option so everything would be treated as a string but it is still removing the zeros.</p>