- bin2hex: documentation ( source)
- array_unshift: documentation ( source)
- implode: documentation ( source)
- str_split: documentation ( source)
- random_bytes: documentation ( source)
<?php
$x = str_split(bin2hex(random_bytes(32)), 2);
array_unshift($x, '');
echo implode('\\x', $x), "\n";