- json_encode: documentation ( source)
<?php
$User = array(
'Name' => "Hans-Peterµµ",
'Contacts' => array(1, 2, 3, 4, 5, 6, 7, 42),
'Active' => 1
);
$JS = json_encode($User, JSON_UNESCAPED_UNICODE);
$J = json_encode($User);
echo $J."<br/>\r\n".$JS;