- var_dump: documentation ( source)
- json_encode: documentation ( source)
<?php
$structure = array(
'id' => 11231,
'message' => "Hello!",
'num_str' => "3",
'num_int' => 3,
'num_float' => 3.0,
'num_big' => 2123123154123341223341562341238712389712331123231123123123121331231,
);
var_dump(json_encode($structure, JSON_PRETTY_PRINT));