[PHP-DOC] cvs: phpdoc /en/reference/url/functions parse-url.xml From: Markus Fischer (mfischer <email protected>)
Date: 06/09/02

mfischer Sun Jun 9 19:37:42 2002 EDT

  Modified files:
    /phpdoc/en/reference/url/functions parse-url.xml
  Log:
  - Document that parse_url does NOT validate the url in anyway, e.g. invalid
    hostnames containg _ are still parsed (closes #12706, #17533).
  
  
Index: phpdoc/en/reference/url/functions/parse-url.xml
diff -u phpdoc/en/reference/url/functions/parse-url.xml:1.3 phpdoc/en/reference/url/functions/parse-url.xml:1.4
--- phpdoc/en/reference/url/functions/parse-url.xml:1.3 Thu May 2 07:00:39 2002
+++ phpdoc/en/reference/url/functions/parse-url.xml Sun Jun 9 19:37:41 2002
@@ -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 <email protected>/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>