Field values in the PHP takes ResultSet

[PHP] learning record

Ali encountered in PHP SDK function returns the result as a resultset type, the first time I saw, at first thought it was json, with json_decrypt error, then figure out how to use the

On example: var_dump data was as follows

object(SimpleXMLElement)#4 (2) { ["result"]=> object(SimpleXMLElement)#5 (3) { ["err_code"]=> string(1) "0" ["model"]=> string(26) "xxxxxx^xxxxxx" ["success"]=> string(4) "true" } ["request_id"]=> string(12) "xxxxx"}

 The results can be seen from the return somewhat like JSON format, there err_code, model, success at three fields result, the

Taken individually success field values:

$str=$resultset->result->success;

Remove err_code field values:

$str=$resultset->result->err_code;



 What better you can also share value method under ~


Published 18 original articles · won praise 8 · views 30000 +

Guess you like

Origin blog.csdn.net/qq_20408397/article/details/73008090