public static function bytes2int($str, $l = false)
    {
        if ($l) {
            $str = strrev($str);
        }

        $dec = 0;
        $len = strlen($str);

        for ($i = 0; $i < $len; ++$i)
        {
            $dec += ord(static::binarySubstr($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 = strlen($str);

        for ($i = 0; $i < $len; ++$i)
        {
            $dec += ord(static::binarySubstr($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 = strlen ( $ str ) ; for ( $ i = 0 ; $ i < $ len ; ++ $ i ) { $ dec += ord ( static :: binarySubstr ( $ str , $ i , 1 ) ) * pow ( 0x100 , $ len - $ i - 1 ) ; } return $ dec ; }
Convert bytes into integer.

@param string $str
@param bool $l little-endian encoding, defaults to false
@return int
Convert bytes into integer .