public static function bytes2int($str, $l = false)
    {
        if ($l) {
            $str = strrev($str);
        }
        $dec = 0;
        $len = mb_orig_strlen($str);
        for ($i = 0; $i < $len; ++$i) {
            $dec += ord(mb_orig_substr($str, $i, 1)) * pow(0x100, $len - $i - 1);
        }
        return $dec;
    }
public static function bytes2int($str, $l = false)
    {
        if ($l) {
            $str = strrev($str);
        }
        $dec = 0;
        $len = mb_orig_strlen($str);
        for ($i = 0; $i < $len; ++$i) {
            $dec += ord(mb_orig_substr($str, $i, 1)) * pow(0x100, $len - $i - 1);
        }
        return $dec;
    }
public static function bytes2int ( $ str , $ l = false ) { if ( $ l ) { $ str = strrev ( $ str ) ; } $ dec = 0 ; $ len = mb_orig_strlen ( $ str ) ; for ( $ i = 0 ; $ i < $ len ; ++ $ i ) { $ dec += ord ( mb_orig_substr ( $ str , $ i , 1 ) ) * pow ( 0x100 , $ len - $ i - 1 ) ; } return $ dec ; }
Convert bytes into integer
@param  string $str Bytes
@param  boolean $l Little endian? Default is false
@return integer
Convert bytes into integer