我在a.json
中有这段代码:
{
"body" : {
"outboundSMSMessageRequest": {
"address": [
"9456654978" /* 1 */
],
"senderAddress": " 64735 ", /* 3 */
"outboundSMSTextMessage": {
"message": "Welcome to fgf Your Confirmation Code - " /* 2 */
},
"clientCorrelator": "1", /* 4 */
"receiptRequest": {
"notifyURL": "2", /* 5 */
"callbackData": "3" /* 6 */
},
"senderName": "4" /* 7 */
}
}
}
我想打印上面标记的值(仅限1,3,2,4,5,6,7,值)。我试过这个:
$jsonData = file_get_contents("a.json");
$json = json_decode($jsonData,true);
echo $json;
但我最终得到以下通知:
PHP注意:数组转换为字符串
如何根据需要打印值?