public static function formatIniParamSize(string $res): int
    {
        $res = trim($res);
        $measure = strtolower($res[strlen($res) - 1]);
        $res = (int)$res;

        // No breaks in switch, because we need multiple calculations
        switch ($measure) {
            /** @noinspection PhpMissingBreakStatementInspection */
            case 'g':
                $res *= 1024;
            /** @noinspection PhpMissingBreakStatementInspection */
            case 'm':
                $res *= 1024;
            case 'k':
                $res *= 1024;
        }

        return $res;
    }
public static function formatIniParamSize(string $res): int
    {
        $res = trim($res);
        $measure = strtolower($res[strlen($res) - 1]);
        $res = (int)$res;

        // No breaks in switch, because we need multiple calculations
        switch ($measure) {
            /** @noinspection PhpMissingBreakStatementInspection */
            case 'g':
                $res *= 1024;
            /** @noinspection PhpMissingBreakStatementInspection */
            case 'm':
                $res *= 1024;
            case 'k':
                $res *= 1024;
        }

        return $res;
    }
public static function formatIniParamSize ( string $ res ) : int { $ res = trim ( $ res ) ; $ measure = strtolower ( $ res [ strlen ( $ res ) - 1 ] ) ; $ res = ( int ) $ res ; // No breaks in switch, because we need multiple calculations switch ( $ measure ) { /** @noinspection PhpMissingBreakStatementInspection */ case 'g' : $ res *= 1024 ; /** @noinspection PhpMissingBreakStatementInspection */ case 'm' : $ res *= 1024 ; case 'k' : $ res *= 1024 ; } return $ res ; }
Get size from formatted ini params string

@param string $res

@return int - size in bytes
Get size from formatted ini params string