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:
stdClass Object
(
[success] => 1
[message] => Array
(
[code] => 000
[txt] => Operation successful
)
[data] => Array
(
[result] => OK
[accountID] => 000000000
[group] => demoCAC
[currency] => USD
[enable] => 1
[read_only] => 0
[name] => Bogus Demo
[country] => ****
[city] =>
[address] =>
[phone] => **
[email] => ***@gmail.com
[status] => test
[regdate] => 07/02/2017 09:57
[lastdate] => 07/02/2017 09:57
[balance] => 0.00
[credit] => 0.00
[equity] => 10000.00
[isDemo] => 1
[tp_version] => **
[last_name] => Demo
[first_name] => Bogus
[domain] => ***.com
[compliance] =>
[latestTrades] => Array
(
[results] => Array
(
)
[totalResults] => 0
)
[owner] =>
)
)
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:
Warning: get_object_vars() expects parameter 1 to be object, string given in /home/**/public_html/crm/profile.php on line 20