A character $str = (Pack ("A *", "China")); echo $str, "=", strlen ($STR), "Byte n"; Getascill ($STR); H character $str = (Pack ("h*", "Fffe")); echo $str, "=", strlen ($STR), "Byte n"; Getascill ($STR); C character $str = (Pack ("c*", "55", "56", "57")); echo $str, "=", strlen ($STR), "Byte n"; Getascill ($STR); I-character short-shaped 32-bit 4-byte 64-bit 8-byte $str = (Pack ("I", "100")); echo $str, "=", strlen ($STR), "Byte n"; Getascill ($STR); s character short shaping 2 bytes $str = (Pack ("s", "100")); echo $str, "=", strlen ($STR), "Byte n"; Getascill ($STR); L character-length shaping 4 bytes $str = (Pack ("L", "100")); echo $str, "=", strlen ($STR), "Byte n"; Getascill ($STR); F-character single-precision floating-point 4 bytes $str = (Pack ("F", "100")); echo $str, "=", strlen ($STR), "Byte n"; Getascill ($STR); D-character double-precision floating-point 8 bytes $str = (Pack ("D", "100")); echo $str, "=", strlen ($STR), "Byte n"; Getascill ($STR); function Getascill ($STR) { $arr =str_split ($STR); foreach ($arr as $v) { echo $v, "=", Ord ($v), "n"; } echo "=============RNRN"; } ?> |