public static function getIntegerValue($value)
    {
        if (!is_numeric($value)) {
            // strip excessive whitespace
            $value = trim($value);
            // strip comparison operator
            $value = ltrim($value, '<>!=');
            // remove the K|M|G suffix if necessary
            $len = strlen($value);
            if (!is_numeric($value)) {
                $quantity = substr($value, 0, $len - 1);
                // we need this, as PHP sets a memory_limit of 0 if the ini value is 0.25M
                // another example: 2.75M will be 2M for PHP (e.g. on post_max_size)
                $quantity = intval($quantity);
            } else {
                $quantity = $value;
            }
            // get unit if this string represents a byte value
            $unit = strtolower(substr($value, $len - 1));
            switch ($unit) {
                case 'k':
                    $quantity *= 1024;
                    break;
                case 'm':
                    $quantity *= 1048576;
                    break;
                case 'g':
                    $quantity *= 1073741824;
                    break;
            }

            return $quantity;
        }

        return intval($value);
    }
public static function getIntegerValue($value)
    {
        if (!is_numeric($value)) {
            // strip excessive whitespace
            $value = trim($value);
            // strip comparison operator
            $value = ltrim($value, '<>!=');
            // remove the K|M|G suffix if necessary
            $len = strlen($value);
            if (!is_numeric($value)) {
                $quantity = substr($value, 0, $len - 1);
                // we need this, as PHP sets a memory_limit of 0 if the ini value is 0.25M
                // another example: 2.75M will be 2M for PHP (e.g. on post_max_size)
                $quantity = intval($quantity);
            } else {
                $quantity = $value;
            }
            // get unit if this string represents a byte value
            $unit = strtolower(substr($value, $len - 1));
            switch ($unit) {
                case 'k':
                    $quantity *= 1024;
                    break;
                case 'm':
                    $quantity *= 1048576;
                    break;
                case 'g':
                    $quantity *= 1073741824;
                    break;
            }

            return $quantity;
        }

        return intval($value);
    }
public static function getIntegerValue ( $ value ) { if ( ! is_numeric ( $ value ) ) { // strip excessive whitespace $ value = trim ( $ value ) ; // strip comparison operator $ value = ltrim ( $ value , '<>!=' ) ; // remove the K|M|G suffix if necessary $ len = strlen ( $ value ) ; if ( ! is_numeric ( $ value ) ) { $ quantity = substr ( $ value , 0 , $ len - 1 ) ; // we need this, as PHP sets a memory_limit of 0 if the ini value is 0.25M // another example: 2.75M will be 2M for PHP (e.g. on post_max_size) $ quantity = intval ( $ quantity ) ; } else { $ quantity = $ value ; } // get unit if this string represents a byte value $ unit = strtolower ( substr ( $ value , $ len - 1 ) ) ; switch ( $ unit ) { case 'k' : $ quantity *= 1024 ; break ; case 'm' : $ quantity *= 1048576 ; break ; case 'g' : $ quantity *= 1073741824 ; break ; } return $ quantity ; } return intval ( $ value ) ; }
Returns the integer value of the given value.

@param mixed $value string to interpret (e.g. ">=2.75M")

@return int integer value as PHP interprets it on ini settings
Returns the integer value of the given value .