public static function SANITIZE_STORAGE_CAPACITY($value){
		if( preg_match('/^\s*(\d+\.?\d*)\s*(MB|GB|TB|PB)?\s*$/', $value, $matches)){		
			// matches single value
			if(empty($matches[2])) {$matches[2]='TB';};
			$value= $matches[1]*static::FIND_STORAGE_MULTIPLIER($matches[2]);
			return "$value..$value";
		} elseif( preg_match('/(\d+\.?\d*)\s*(MB|GB|TB|PB)?\s*to\s*(\d+\.?\d*)\s*(MB|GB|TB|PB)?\s*/', $value, $matches)){	
			// matches a range of values
			list(,$from,$fromUnit,$to, $toUnit) = $matches;
			if(empty($toUnit)) {$toUnit=empty($fromUnit)?'B':$fromUnit;};
			if(empty($fromUnit)) {$fromUnit=$toUnit;}
			return static::FILTER_SANITIZE_RANGE(sprintf('%s..%s',$from*static::FIND_STORAGE_MULTIPLIER($fromUnit),$to*static::FIND_STORAGE_MULTIPLIER($toUnit)));
		} else {
			return null;
		}
	}
public static function SANITIZE_STORAGE_CAPACITY($value){
		if( preg_match('/^\s*(\d+\.?\d*)\s*(MB|GB|TB|PB)?\s*$/', $value, $matches)){		
			// matches single value
			if(empty($matches[2])) {$matches[2]='TB';};
			$value= $matches[1]*static::FIND_STORAGE_MULTIPLIER($matches[2]);
			return "$value..$value";
		} elseif( preg_match('/(\d+\.?\d*)\s*(MB|GB|TB|PB)?\s*to\s*(\d+\.?\d*)\s*(MB|GB|TB|PB)?\s*/', $value, $matches)){	
			// matches a range of values
			list(,$from,$fromUnit,$to, $toUnit) = $matches;
			if(empty($toUnit)) {$toUnit=empty($fromUnit)?'B':$fromUnit;};
			if(empty($fromUnit)) {$fromUnit=$toUnit;}
			return static::FILTER_SANITIZE_RANGE(sprintf('%s..%s',$from*static::FIND_STORAGE_MULTIPLIER($fromUnit),$to*static::FIND_STORAGE_MULTIPLIER($toUnit)));
		} else {
			return null;
		}
	}
public static function SANITIZE_STORAGE_CAPACITY ( $ value ) { if ( preg_match ( '/^\s*(\d+\.?\d*)\s*(MB|GB|TB|PB)?\s*$/' , $ value , $ matches ) ) { // matches single value if ( empty ( $ matches [ 2 ] ) ) { $ matches [ 2 ] = 'TB' ; } ; $ value = $ matches [ 1 ] * static :: FIND_STORAGE_MULTIPLIER ( $ matches [ 2 ] ) ; return "$value..$value" ; } elseif ( preg_match ( '/(\d+\.?\d*)\s*(MB|GB|TB|PB)?\s*to\s*(\d+\.?\d*)\s*(MB|GB|TB|PB)?\s*/' , $ value , $ matches ) ) { // matches a range of values list ( , $ from , $ fromUnit , $ to , $ toUnit ) = $ matches ; if ( empty ( $ toUnit ) ) { $ toUnit = empty ( $ fromUnit ) ? 'B' : $ fromUnit ; } ; if ( empty ( $ fromUnit ) ) { $ fromUnit = $ toUnit ; } return static :: FILTER_SANITIZE_RANGE ( sprintf ( '%s..%s' , $ from * static :: FIND_STORAGE_MULTIPLIER ( $ fromUnit ) , $ to * static :: FIND_STORAGE_MULTIPLIER ( $ toUnit ) ) ) ; } else { return null ; } }
this function normalize Storage Capacity in TB
this function normalize Storage Capacity in TB