- var_dump: documentation ( source)
- base64_encode: documentation ( source)
- json_encode: documentation ( source)
<?php
$data = [
'account_id' => 12345,
'created_at' => '2018-10-31 09:30:00.000000',
'customer_id' => 23456,
'originator' => 'MessageBird',
'is_ported' => true,
'body' => base64_encode("Contents \xF0\x9F\x98\x83"),
];
$json = json_encode($data);
var_dump($json);