可能是重复问题:
PHP ToString() 等价物
如何在 PHP 中将对象转换为字符串
我正在处理 Web 服务 API。我想使用一个 API 的输出作为另一个 API 的输入。当我尝试这样做时,我得到了以下错误:Catchable fatal error: Object of class std could not be converted to string in C:\ ...
这是第一个 API 的输出:stdClass Object ( [document_number] => 10ba60 ),现在我只想使用那个数字作为第二个 API 的输入。
print_r 和 _string() 都不能解决我的问题。