public static function getBytes($value){

		$value = trim($value);
		$unit = $value{strlen($value)-1};

		$value = floatval($value);

		switch(strtolower($unit)){

			case 'g':

				$multiplier = 1073741824;

			break;

			case 'm':

				$multiplier = 1048576;

			break;

			case 'k':

				$multiplier = 1024;

			break;

			default:

				ExceptionHandler::notice('Number::getBytes() expects unit to be either "g", "m" or "k"');
				$multiplier = 1;
		}

		return $multiplier * $value;
	}
public static function getBytes($value){

		$value = trim($value);
		$unit = $value{strlen($value)-1};

		$value = floatval($value);

		switch(strtolower($unit)){

			case 'g':

				$multiplier = 1073741824;

			break;

			case 'm':

				$multiplier = 1048576;

			break;

			case 'k':

				$multiplier = 1024;

			break;

			default:

				ExceptionHandler::notice('Number::getBytes() expects unit to be either "g", "m" or "k"');
				$multiplier = 1;
		}

		return $multiplier * $value;
	}
public static function getBytes ( $ value ) { $ value = trim ( $ value ) ; $ unit = $ value { strlen ( $ value ) - 1 } ; $ value = floatval ( $ value ) ; switch ( strtolower ( $ unit ) ) { case 'g' : $ multiplier = 1073741824 ; break ; case 'm' : $ multiplier = 1048576 ; break ; case 'k' : $ multiplier = 1024 ; break ; default : ExceptionHandler :: notice ( 'Number::getBytes() expects unit to be either "g", "m" or "k"' ) ; $ multiplier = 1 ; } return $ multiplier * $ value ; }
Get the number of bytes in a pretty-formated binary size string.

<p>Turns values like "1M" or "1.5K" into the actual number of bytes
these values represent.</p>

@param string $value
@return float
Get the number of bytes in a pretty - formated binary size string .