3v4l.org

run code in 300+ PHP versions simultaneously
<?php function str_baseconvert($str, $frombase=16, $tobase=36) { $str = trim($str); if (intval($frombase) != 10) { $len = strlen($str); $q = 0; for ($i=0; $i<$len; $i++) { $r = base_convert($str[$i], $frombase, 10); $q = bcadd(bcmul($q, $frombase), $r); } } else $q = $str; if (intval($tobase) != 10) { $s = ''; while (bccomp($q, '0', 0) > 0) { $r = intval(bcmod($q, $tobase)); $s = base_convert($r, 10, $tobase) . $s; $q = bcdiv($q, $tobase, 0); } } else $s = $q; return $s; } $base16string = '5576F4CE68664C0000000000000000000000000'; $base36string = str_baseconvert($base16string,16,36); echo $base36string;

preferences:
53.08 ms | 402 KiB | 5 Q