Requests_IRI::set_port

Advertisement

Summery Summery

Set the port. Returns true on success, false on failure (if there are any invalid characters).

Syntax Syntax

Requests_IRI::set_port( string $port )

Parameters Parameters

$port

(string) (Required)

Return Return

(bool)

Source Source

File: wp-includes/Requests/IRI.php

	protected function set_port($port) {
		if ($port === null) {
			$this->port = null;
			return true;
		}

		if (strspn($port, '0123456789') === strlen($port)) {
			$this->port = (int) $port;
			$this->scheme_normalization();
			return true;
		}

		$this->port = null;
		return false;
	}

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.