<?php
	/**
	 * Get a numeric value from php.ini
	 *
	 * @param string $option
	 * @param boolean $asString disabling this will cast values like '32M' to their 'real' integer/float value
	 * @return mixed string|int|float the value from php.ini
	 */
	public static function getIniValueNumber($option, $asString = true) {
		$value = ini_get($option);

		if(!$asString) {
			switch(strtoupper($value[strlen($value) - 1])) {
				case 'K':
					$value *= 1024;
					break;
				case 'M':
					$value *= 1024 * 1024;
					break;
				case 'G':
					$value *= 1024 * 1024 * 1024;
					break;
				default :
					if(t3lib_div::testInt($value)) {
						$value = (int) $value;
					}
					break;
			}
		}

		return $value;
	}
?>