- var_dump: documentation ( source)
- chr: documentation ( source)
- json_decode: documentation ( source)
- json_encode: documentation ( source)
<?php
$string = '';
for ($i=0; $i < 128; $i++) {
$string .= chr($i);
}
$encoded = json_encode($string, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
$decoded =json_decode($encoded, TRUE);
var_dump($string == $decoded);