title: How to convert string as stdClass object to array [PHP]
body: <p>I'm coding a login system using API.
  i'm stuck with the result that i got using the API.
  I got the result as normal string like this:</p>
  
  <pre><code>stdClass Object
  (
      [success] =&gt; 1
      [message] =&gt; Array
          (
              [code] =&gt; 000
              [txt] =&gt; Operation successful
          )
  
      [data] =&gt; Array
          (
              [result] =&gt; OK
              [accountID] =&gt; 000000000
              [group] =&gt; demoCAC
              [currency] =&gt; USD
              [enable] =&gt; 1
              [read_only] =&gt; 0
              [name] =&gt; Bogus Demo
              [country] =&gt; ****
              [city] =&gt; 
              [address] =&gt; 
              [phone] =&gt; **
              [email] =&gt; ***@gmail.com
              [status] =&gt; test
              [regdate] =&gt; 07/02/2017 09:57
              [lastdate] =&gt; 07/02/2017 09:57
              [balance] =&gt; 0.00
              [credit] =&gt; 0.00
              [equity] =&gt; 10000.00
              [isDemo] =&gt; 1
              [tp_version] =&gt; **
              [last_name] =&gt; Demo
              [first_name] =&gt; Bogus
              [domain] =&gt; ***.com
              [compliance] =&gt; 
              [latestTrades] =&gt; Array
                  (
                      [results] =&gt; Array
                          (
                          )
  
                      [totalResults] =&gt; 0
                  )
  
              [owner] =&gt; 
          )
      )
  </code></pre>
  
  <p>So how can i convert it to an array or useable variable ?
  * This information printed by ( echo ), 
  and i can't access $result -> data ->...
  is there a function that convert this string to array or json or something readable so i can reach to specific value?
  when i try :
   print_r(get_object_vars($result));
  i get this error:</p>
  
  <p>Warning:  get_object_vars() expects parameter 1 to be object, string given in /home/**/public_html/crm/profile.php on line 20</p>