- decbin: documentation ( source)
- str_pad: documentation ( source)
- str_split: documentation ( source)
<?php
echo "a | b\n";
for($i = 0; $i < 4; $i++){
list($a, $b) = str_split(str_pad(decbin($i), 2, 0, STR_PAD_LEFT));
echo "$a | $b | " . $a|$b;
echo "\n";
}