public function is_phone($type=null) {
		if (! \is_null($type)) {
			// We want an array with lowercase strings.
			r_cast::array($type);
			foreach ($type as $k=>$v) {
				if (\is_string($type[$k])) {
					$type[$k] = \strtolower($type[$k]);
				}

				if (! $type[$k]) {
					unset($type[$k]);
				}
			}

			if (! \count($type)) {
				$type = null;
			}
		}

		return (
			(false !== $this->phone) &&
			(\is_null($type) || \count(\array_intersect($type, $this->phone['types'])))
		);
	}
public function is_phone($type=null) {
		if (! \is_null($type)) {
			// We want an array with lowercase strings.
			r_cast::array($type);
			foreach ($type as $k=>$v) {
				if (\is_string($type[$k])) {
					$type[$k] = \strtolower($type[$k]);
				}

				if (! $type[$k]) {
					unset($type[$k]);
				}
			}

			if (! \count($type)) {
				$type = null;
			}
		}

		return (
			(false !== $this->phone) &&
			(\is_null($type) || \count(\array_intersect($type, $this->phone['types'])))
		);
	}
public function is_phone ( $ type = null ) { if ( ! \ is_null ( $ type ) ) { // We want an array with lowercase strings. r_cast :: array ( $ type ) ; foreach ( $ type as $ k => $ v ) { if ( \ is_string ( $ type [ $ k ] ) ) { $ type [ $ k ] = \ strtolower ( $ type [ $ k ] ) ; } if ( ! $ type [ $ k ] ) { unset ( $ type [ $ k ] ) ; } } if ( ! \ count ( $ type ) ) { $ type = null ; } } return ( ( false !== $ this -> phone ) && ( \ is_null ( $ type ) || \ count ( \ array_intersect ( $ type , $ this -> phone [ 'types' ] ) ) ) ) ; }
Is Phone Valid?

Check if a phone number is valid, optionally
of a specific type (e.g. Mobile).

@param string $type Type.
@return bool True/false.
Is Phone Valid?