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