Php 将安全json转换为';常规';一小条

Php 将安全json转换为';常规';一小条,php,json,Php,Json,我正在测试我的一些像素火灾,我有以下问题。我有一个页面请求信息: <? $pixel = file_get_contents("http://127.0.0.1/api/v1/pixel/preq/pixel/10102.json"); echo $pixel; 我得到以下错误: Catchable fatal error: Object of class stdClass could not be converted to string in plugins\plg_pixelwise

我正在测试我的一些像素火灾,我有以下问题。我有一个页面请求信息:

<?
$pixel = file_get_contents("http://127.0.0.1/api/v1/pixel/preq/pixel/10102.json");
echo $pixel;
我得到以下错误:

Catchable fatal error: Object of class stdClass could not be converted to string in plugins\plg_pixelwise\test.php on line 3

json\u decode
返回一个对象或数组(如果您提供可选的第二个参数
true
)。如果对象不提供u u-toString方法,只能提供字符串或数字,则无法回显对象(可以回显数组,但它们只打印“数组”)

尝试:


json\u decode
返回一个对象或数组(如果您提供可选的第二个参数
true
)。如果对象不提供u u-toString方法,只能提供字符串或数字,则无法回显对象(可以回显数组,但它们只打印“数组”)

尝试:


好吧,现在我觉得很傻,这很有效。谢谢。现在我觉得自己很傻,这很有效。非常感谢。
<?
$pixel = file_get_contents("http://127.0.0.1/api/v1/pixel/preq/pixel/10102.json");
echo json_decode($pixel);
Catchable fatal error: Object of class stdClass could not be converted to string in plugins\plg_pixelwise\test.php on line 3
var_dump(json_decode($pixel));