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