/** * Custom multiple, to get decimal corresponding to the multiple of the set of the multiple * @param $str Custom Multiple String * @param $num decimal number * @return The corresponding number of binary digits/function
XBin ($str, $num) {$num = Floatval ($num);
$x = strlen ($STR);
$arr = Str_split ($STR);
$digit = Fmod ($num, $x); $xbin = Isset ($arr [$digit])?
$arr [$digit]: null;
$pre _digit = Floor ($num/$x);
if ($pre _digit >= 1) {$pre _digit = XBin ($str, $pre _digit);
Return $pre _digit. $xbin;
return $xbin;
//Test 8 $str = ' 01234567 ';
$a = XBin ($str, 9);
$b = decoct (9); Dump ($a); String (2) "One" Dump ($b);
String (2) "11"//Test 16 $str = ' 0123456789abcdef ';
$a = XBin ($str, 31);
$b = Dechex (31); Dump ($a); String (2) "1f" Dump ($b);
String (2) "1f"//Custom 30 binary $str = ' 0123456789abcdefghijklmnopqrst ';
$a = XBin ($str, 59); Dump ($a); String (2) "1t"//Custom 92 $STR = ' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ' ~!@#$%^&* () =
[];\ ',./{}: "<>?\|";
$a = XBin ($str, 183); Dump ($a); String (2) "1|"