title: Checking json output status using if in php
body: <p>I'm using cPanel xml-api class and its json output gives me the following when creating a user account,</p>
  
  <p>I've passed an invalid username here .</p>
  
  <p>What I require is to store the output in a variable and check if it is successful or not,</p>
  
  <p>Output :</p>
  
  <pre><code>{"result":[{"status":0,"statusmsg":"Sorry, that username is reserved.","rawout":null,"options":null}]}
  </code></pre>
  
  <p>if($result->status=1) then it will print success otherwise print failure also is it possible to print the errormsg with the failure msg.</p>
  
  <p>Thanks</p>