- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconvert.php
More file actions
Latest commit
27 lines (23 loc) · 646 Bytes
/
Copy pathconvert.php
File metadata and controls
27 lines (23 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
//mb_internal_encoding("ISO-8859-1");
$encoding = mb_internal_encoding();
echo"internal encoding: " . $encoding . PHP_EOL;
$input = [];
$input[] = chr(197);
$input[] = "\xC5";
$input[] = utf8_encode(chr(197));
//$input[] = utf8_decode(chr(197));
foreach ($inputas$i) {
$encoding = mb_detect_encoding($i);
$ord = ord($i);
$unpacked = unpack('H*', $i)[1];
$bin = chunk_split(str_pad(base_convert($unpacked, 16, 2), 16, 0, STR_PAD_LEFT), 8, "");
print_r(Array(
"\$i" => $i,
"ord" => $ord,
"encoding" => $encoding,
"unpack" => $unpacked,
"bin" => $bin
));
}
echoPHP_EOL;