Note: this function changes the byte order. If your machines byte-order is little-endian, this function will change it to big-endian. If your machines byte-order is big-endian, it will change the number to big-endian.

All x86 and x86_64 are little-endian. ARM can be both. More can be found on this wiki article

In PHP you might have to convert the endianness of a number. PHP does not provide any function for this even though it has function for almost everything.
So I wrote a function for this,
[code language="php"]
function chbo($num) {
$data = dechex($num);
if (strlen($data) <= 2)