- strtoupper: documentation ( source)
- dechex: documentation ( source)
- strtolower: documentation ( source)
- str_pad: documentation ( source)
<?php
echo "<?php\n\n";
foreach (['e', 'f', 'n', 'r', 't', 'v'] as $c) {
echo "define('\\\\{$c}', \"\\{$c}\");\n";
}
for ($i = 0; $i < 256; $i++) {
$str = str_pad(strtoupper(dechex($i)), 2, '0', STR_PAD_LEFT);
$p1 = [$str[0]];
if ($str[0] >= 'A' && $str[0] <= 'F') {
$p1[] = strtolower($str[0]);
}
$p2 = [$str[1]];
if ($str[1] >= 'A' && $str[1] <= 'F') {
$p2[] = strtolower($str[1]);
}
foreach ($p1 as $c1) foreach ($p2 as $c2) echo "define('\\\\x{$c1}{$c2}', \"\\x{$str}\");\n";
}
This script was stopped while abusing our resources