I have this code in 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 */
}
}
}
I want to print the values as marked above (1, 3, 2, 4, 5, 6, 7, the values only). I have tried this:
$jsonData = file_get_contents("a.json");
$json = json_decode($jsonData,true);
echo $json;
but I end up with the following notice:
PHP Notice: Array to string conversion
How can I print the values as desired?