- var_dump: documentation ( source)
- pack: documentation ( source)
- utf8_encode: documentation ( source)
- json_encode: documentation ( source)
<?php
$str = array('hello' => 'json' . pack("H*" ,'c32e') );
// var_dump(json_encode($str));
// $str['test'] = htmlentities( (string) $str['test'], ENT_QUOTES, 'utf-8', FALSE);
// $str['hello'] = iconv('UTF-8', 'UTF-8//IGNORE', $str['hello']);
$str['hello'] = utf8_encode( $str['hello'] );
var_dump(json_encode($str));