- array_reduce: documentation ( source)
- decbin: documentation ( source)
- strrev: documentation ( source)
- str_pad: documentation ( source)
<?php
$array = [178, 89, 1];
echo array_reduce($array, function ($acc, $byte) {
return $acc.strrev(str_pad(decbin($byte), 8, 0, STR_PAD_LEFT));
});