- json_encode: documentation ( source)
<?php
echo json_encode(
[
'fulfillmentMessages' => [
[
'text' => [
'text' => [
'Text response from webhook',
]
]
]
]
],
JSON_PRETTY_PRINT
);