protected function toBytes($str){
        $val = substr(trim($str), 0, strlen($str)-1);
        $last = strtolower($str[strlen($str)-1]);
        switch($last) {
            case 'g': $val *= 1024;
            case 'm': $val *= 1024;
            case 'k': $val *= 1024;
        }
        return $val;
    }
protected function toBytes($str){
        $val = substr(trim($str), 0, strlen($str)-1);
        $last = strtolower($str[strlen($str)-1]);
        switch($last) {
            case 'g': $val *= 1024;
            case 'm': $val *= 1024;
            case 'k': $val *= 1024;
        }
        return $val;
    }
protected function toBytes ( $ str ) { $ val = substr ( trim ( $ str ) , 0 , strlen ( $ str ) - 1 ) ; $ last = strtolower ( $ str [ strlen ( $ str ) - 1 ] ) ; switch ( $ last ) { case 'g' : $ val *= 1024 ; case 'm' : $ val *= 1024 ; case 'k' : $ val *= 1024 ; } return $ val ; }
Converts a given size with units to bytes.
@param string $str
Converts a given size with units to bytes .