"; var_dump($var); echo ""; // header('Content-Type: application/json'); // echo json_encode($var, JSON_INVALID_UTF8_IGNORE | JSON_PRETTY_PRINT); die(); } function dump($var) { echo "
"; var_dump($var); echo ""; //header('Content-Type: application/json'); //echo json_encode($var, JSON_INVALID_UTF8_IGNORE | JSON_PRETTY_PRINT); } function strtobits(string $str): string { $ret = ""; for ($i = 0; $i < strlen($str); ++$i) { $ord = ord($str[$i]); for ($bitnum = 7; $bitnum >= 0; --$bitnum) { if ($ord & (1 << $bitnum)) { $ret .= "1"; } else { $ret .= "0"; } } } return $ret; }