<?php
function _hex2bin($hex)
{
$hex = strtoupper($hex);
$hexLen = strlen($hex);
$bin = [];
for ($i = 0; $i < $hexLen; $i++) {
$char = $hex[$i];
$bin[] = str_pad(base_convert($char, 16, 2), 4, '0', STR_PAD_LEFT);
}
return implode("", $bin);
}
echo _hex2bin("152F302436152F302435152F302434152F302433152F302433");
- Output for 7.0.0 - 7.0.25, 7.1.0 - 7.1.20, 7.2.6 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
- 00010101001011110011000000100100001101100001010100101111001100000010010000110101000101010010111100110000001001000011010000010101001011110011000000100100001100110001010100101111001100000010010000110011
preferences:
129.37 ms | 408 KiB | 5 Q