public static function convertToBytes(string $value): int
    {
        $units = "BKMGT";
        $unit = preg_replace("/[^$units]/i", "", $value);
        $value = floatval($value);
        if ($unit) {
            $value *= pow(1024, stripos($units, $unit[0]));
        }

        return (int) $value;
    }
public static function convertToBytes(string $value): int
    {
        $units = "BKMGT";
        $unit = preg_replace("/[^$units]/i", "", $value);
        $value = floatval($value);
        if ($unit) {
            $value *= pow(1024, stripos($units, $unit[0]));
        }

        return (int) $value;
    }
public static function convertToBytes ( string $ value ) : int { $ units = "BKMGT" ; $ unit = preg_replace ( "/[^$units]/i" , "" , $ value ) ; $ value = floatval ( $ value ) ; if ( $ unit ) { $ value *= pow ( 1024 , stripos ( $ units , $ unit [ 0 ] ) ) ; } return ( int ) $ value ; }
Convert a size string into a bytes integer

@param string $value The size string to convert
@return int
Convert a size string into a bytes integer