mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- Document that parse_url does NOT validate the url in anyway, e.g. invalid
hostnames containg _ are still parsed (closes #12706, #17533). git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@85221 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
e0723bd42d
commit
e91f0dc882
1 changed files with 31 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/url.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.parse-url">
|
||||
<refnamediv>
|
||||
|
@ -58,6 +58,36 @@
|
|||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
This function is <emphasis role="strong">not</emphasis> meant to validate
|
||||
the given URL, it only breaks it up into the above listed parts. Partial
|
||||
urls are also accepted, <function>parse_url</function> tries its best to
|
||||
parse them correctly.
|
||||
</para>
|
||||
<example>
|
||||
<title>Using <function>parse_url</function></title>
|
||||
<screen>
|
||||
$ php -r 'print_r( parse_url("http://username:password@hostname/path?arg=value#anchor"));'
|
||||
Array
|
||||
(
|
||||
[scheme] => http
|
||||
[host] => hostname
|
||||
[user] => username
|
||||
[pass] => password
|
||||
[path] => /path
|
||||
[query] => arg=value
|
||||
[fragment] => anchor
|
||||
)
|
||||
|
||||
$ php -r 'print_r( parse_url("http://invalid_host..name/"));'
|
||||
Array
|
||||
(
|
||||
[scheme] => http
|
||||
[host] => invalid_host..name
|
||||
[path] => /
|
||||
)
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
See also <function>pathinfo</function>.
|
||||
</para>
|
||||
|
|
Loading…
Reference in a new issue