public static function sanitize_phone(&$phone = '') {
		r_cast::string($phone, true);

		// Replace number chars.
		$from = \array_keys(constants::NUMBER_CHARS);
		$to = \array_values(constants::NUMBER_CHARS);
		$phone = \str_replace($from, $to, $phone);

		$phone = \preg_replace('/[^\d]/', '', $phone);

		if (! c_data::length_in_range($phone, static::MIN_LENGTH, static::MAX_LENGTH)) {
			$phone = false;
		}

		return true;
	}
public static function sanitize_phone(&$phone = '') {
		r_cast::string($phone, true);

		// Replace number chars.
		$from = \array_keys(constants::NUMBER_CHARS);
		$to = \array_values(constants::NUMBER_CHARS);
		$phone = \str_replace($from, $to, $phone);

		$phone = \preg_replace('/[^\d]/', '', $phone);

		if (! c_data::length_in_range($phone, static::MIN_LENGTH, static::MAX_LENGTH)) {
			$phone = false;
		}

		return true;
	}
public static function sanitize_phone ( & $ phone = '' ) { r_cast :: string ( $ phone , true ) ; // Replace number chars. $ from = \ array_keys ( constants :: NUMBER_CHARS ) ; $ to = \ array_values ( constants :: NUMBER_CHARS ) ; $ phone = \ str_replace ( $ from , $ to , $ phone ) ; $ phone = \ preg_replace ( '/[^\d]/' , '' , $ phone ) ; if ( ! c_data :: length_in_range ( $ phone , static :: MIN_LENGTH , static :: MAX_LENGTH ) ) { $ phone = false ; } return true ; }
Sanitize Phone Number

Reduce a string to only digits.

@param string $phone Phone number.
@return bool True/false.
Sanitize Phone Number