试图理解print_r()返回

时间:2014-06-20 13:53:29

标签: php soap return

我有一个像这样定义的变量:

$result = $soap_client->CompanycodeGetlist($params);

print_r($results);

请有人帮我理解print_r的回复($ results)?

stdClass Object ( [CompanycodeList] => stdClass Object ( [item] => Array ( [0] => stdClass Object ( [CompCode] => 0001 [CompName] => SAP A.G. ) [1] => stdClass Object ( [CompCode] => 01 [CompName] => Debussy ) [2] => stdClass Object ( [CompCode] => 02 [CompName] => Ravel ) 

任何帮助都会非常感激,我很困惑......

1 个答案:

答案 0 :(得分:0)

$ results是一个具有CompanycodList属性的对象,该属性也是一个具有item属性的对象....

尝试

echo "<pre>";
print_r($results);
echo "</pre>";

获得更清晰的格式化结果。