Requests_IRI::set_scheme()

最后更新于:2021-11-26 04:00:14

Requests_IRI::set_scheme( string$scheme)

Set the scheme. 响应s true on success, false on failure (if there are any invalid characters).

参数

$scheme

(string) (Required)

响应

(bool)

源文件

文件: gc-includes/Requests/IRI.php

	protected function set_scheme($scheme) {
		if ($scheme === null) {
			$this->scheme = null;
		}
		elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+-.]*$/', $scheme)) {
			$this->scheme = null;
			return false;
		}
		else {
			$this->scheme = strtolower($scheme);
		}
		return true;
	}