title: PHP json_decode does not work
body: <p>I am trying the following code to receive JSON . However the decode does not give a result. It works for a copy of the same string with escape slashes.</p>
  
  <pre><code>&lt;?php
  $input = file_get_contents('php://input');
  logToFile("post.txt",$input);
  #Output: {"id":"id1","model":"model1","version":"v1","software":["s1","s2","s3"]}
  
  $data = json_decode($input,true);
  logToFile("post.txt",$data['version']);
  #Output:Empty result
  
  ### Works
  $data1 = json_decode("{\"id\":\"id1\",\"model\":\"model1\",\"version\":\"v1\",\"software\":[\"s1\",\"s2\",\"s3\"]}",true);
  logToFile("post.txt",$data1['version']);
  #Output:v1
  
  function logToFile($filename,$msg)
  {
    $fd=fopen($filename,"a");
    $str="[".date("Y/m/d h:i:s")."]".$msg;
    fwrite($fd,$str."\n");
    fclose($fd);
  }
  ?&gt;
  </code></pre>
  
  <p>I am using PHP 5.4. So it's not a problem in magic quotes. Any help?</p>