8388608 * * \note This method does not recognise other human readable formats like * 8MB, etc. * * @todo Make this function more universal useable. MB, T, etc. * * @param string $val value from php.ini e.g. 2M, 8M * @return int size in bytes */ function phpiniSizeToBytes($val) { $val = trim($val); $num = (double)$val; $unit = strtolower($val[strlen($val)-1]); switch($unit) { case 'g': $num *= 1024; case 'm': $num *= 1024; case 'k': $num *= 1024; default: break; } return (int)$num; }