title: Understanding what \u0000 is in PHP / JSON and getting rid of it
body: <p>I haven't a clue what is going on but I have a string inside an array. It must be a string as I have ran this on it first:</p>
  
  <pre><code>$array[0] = (string)$array[0];
  </code></pre>
  
  <p>If I output $array[0] to the browser in plain text it shows this:</p>
  
  <pre><code>hellothere
  </code></pre>
  
  <p>But if I JSON encode $array I get this:</p>
  
  <pre><code>hello\u0000there
  </code></pre>
  
  <p>Also, I need to separate the 'there' part (the bit after the \u0000), but this doesn't work: </p>
  
  <pre><code>explode('\u0000', $array[0]);
  </code></pre>
  
  <p>I don't even know what \u0000 is or how to control it in PHP.</p>
  
  <p>I did see this link: <a href="https://stackoverflow.com/questions/4892967/trying-to-find-and-get-rid-of-this-u0000-from-my-json">Trying to find and get rid of this \u0000 from my json</a>
  ...which suggests str_replacing the JSON that is generated. I can't do that (and need to separate it as mentioned above first) so I then checked Google for 'php check for backslash \0 byte' but I still can't work out what to do.</p>