- json_decode: documentation ( source)
- print_r: documentation ( source)
<?php
$response = json_decode('{
"responseId": "b19f0045-830e-4d12-a57e-07cdfd55f",
"queryResult": {
"queryText": "yes",
"action": "send.first.question",
"parameters": {},
"allRequiredParamsPresent": true,
"fulfillmentMessages": [{
"text": {
"text": [
""
]
}
}]
}
}');
$response->queryResult->fulfillmentMessages[0]->text->text[0] = "Hello";
print_r($response);