title: JSON decode returns NULL
body: <p>I'm receiving a JSON response from a url which on decoding returns null while decoding it directly from the string it produces gives results.</p>
  
  <p>String returned from the url:</p>
  
  <pre><code>{"status_code":0,"response":{"names":"Bon Charles"},"status_message":"Succeeded."}
  </code></pre>
  
  <p>Result from URL on decoding: NULL
  Result on taking the produced string and hard-coding it into a string:</p>
  
  <pre><code>object(stdClass)#19 (3) { ["status_code"]=&gt; int(0) ["response"]=&gt; object(stdClass)#20 (1) { ["names"]=&gt; string(15) "Bon Charles" } ["status_message"]=&gt; string(16) "Succeeded." }
  </code></pre>
  
  <p>Below is the function that calls the url for the response:</p>
  
  <pre><code>public function checkLoginStatus() {
          $status = $this-&gt;postLoginsJSON();
  
          $values = json_decode($status);
          $json_string = '{"status_code":0,"response":{"names":"Bon Charles"},"status_message":"Login Succeeded."}';
          $a = json_decode($json_string);
          var_dump($values);//returns null
          var_dump($a);//returns values
      }
  </code></pre>
  
  <p>Kindly assist.</p>