提问人:Mihir Dhabalia 提问时间:6/10/2023 最后编辑:shingoMihir Dhabalia 更新时间:6/13/2023 访问量:48
如何使用PHP从中打印状态
How to print status from this using PHP
问:
stdClass Object
(
[status] => success
[message] => stdClass Object
(
[key] => stdClass Object
(
[remoteJid] => [email protected]
[fromMe] => 1
[id] => BAE56CB55463AFE9
)
[message] => stdClass Object
(
[documentMessage] => stdClass Object
(
[url] => some url
[mimetype] => application/pdf
[fileSha256] => hnB2OoCAoeO7lw6d6FFhankwG1UFHfnRCa+1mZisrfI=
[fileLength] => 4115
[mediaKey] => EfLEM03VY6ojspurx2b42H4ZQZh+8blcGZaa+mBiWhs=
[fileName] => To, abc.pdf
[fileEncSha256] => np/RpzMPZZVXzGJaMzu64R13vCAez4Pm10CTOK4+QmE=
[directPath] => /v/t62.711
[mediaKeyTimestamp] => 1686313196
[caption] => Thanks & Regards.
)
)
[messageTimestamp] => 1686313196
)
)
从我存储在 $output 中的 curl 获取此输出。
我试过: 回声 $output->状态
答:
0赞
shubhada
6/11/2023
#1
要从变量访问状态字段,您可以使用以下 PHP 代码:$output
$data = json_decode($output); // Decode the JSON response into a PHP object
$status = $data->status; // Access the "status" field
echo $status;
评论
echo $output
print_r($output)