public static function convertFromBinary($string, $characters) {
        if ($string === '' || empty($characters)) {
            return '';
        }
        $string   = str_split($string);
        $callback = function($str) {
                return ord($str);
            };
        $string    = array_map($callback, $string);
        $converted = static::baseConvert($string, 256, strlen($characters));
        $callback  = function ($num) use ($characters) {
                return $characters[$num];
            };
        $ret = implode('', array_map($callback, $converted));
        return $ret;
    }
public static function convertFromBinary($string, $characters) {
        if ($string === '' || empty($characters)) {
            return '';
        }
        $string   = str_split($string);
        $callback = function($str) {
                return ord($str);
            };
        $string    = array_map($callback, $string);
        $converted = static::baseConvert($string, 256, strlen($characters));
        $callback  = function ($num) use ($characters) {
                return $characters[$num];
            };
        $ret = implode('', array_map($callback, $converted));
        return $ret;
    }
public static function convertFromBinary ( $ string , $ characters ) { if ( $ string === '' || empty ( $ characters ) ) { return '' ; } $ string = str_split ( $ string ) ; $ callback = function ( $ str ) { return ord ( $ str ) ; } ; $ string = array_map ( $ callback , $ string ) ; $ converted = static :: baseConvert ( $ string , 256 , strlen ( $ characters ) ) ; $ callback = function ( $ num ) use ( $ characters ) { return $ characters [ $ num ] ; } ; $ ret = implode ( '' , array_map ( $ callback , $ converted ) ) ; return $ ret ; }
Convert from a raw binary string to a string of characters

@param string $string     The string to convert from
@param string $characters The list of characters to convert to

@return string The converted string
Convert from a raw binary string to a string of characters