Used By
Used By | Description |
---|---|
wp-includes/Requests/IRI.php: Requests_IRI::get_uri() | Get the complete URI |
wp-includes/Requests/IRI.php: Requests_IRI::get_authority() | Get the complete authority |
Convert an IRI to a URI (or parts thereof)
(string|bool) (Required) IRI to convert (or false from get_iri)
(string|false) URI if IRI is valid, false otherwise.
File: wp-includes/Requests/IRI.php
protected function to_uri($string) { if (!is_string($string)) { return false; } static $non_ascii; if (!$non_ascii) { $non_ascii = implode('', range("\x80", "\xFF")); } $position = 0; $strlen = strlen($string); while (($position += strcspn($string, $non_ascii, $position)) < $strlen) { $string = substr_replace($string, sprintf('%%%02X', ord($string[$position])), $position, 1); $position += 3; $strlen += 2; } return $string; }
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/requests_iri/to_uri