cvs: phpdoc-zh /reference/url/functions urldecode.xml urlencode.xml
| From: | Krazy Nio | Date: | Thu, 11 Dec 2003 12:53:38 +0000 |
| Subject: | cvs: phpdoc-zh /reference/url/functions urldecode.xml urlencode.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-1798@lists.php.net to get a copy of this message | ||
nio Thu Dec 11 07:53:38 2003 EDT
Added files:
/phpdoc-zh/reference/url/functions urldecode.xml urlencode.xml
Log:
Add files.
Index: phpdoc-zh/reference/url/functions/urldecode.xml
+++ phpdoc-zh/reference/url/functions/urldecode.xml
<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.1 $ -->
<!-- $Author: nio $ -->
<!-- EN-Revision: 1.3 Maintainer: nio Status: ready -->
<!-- splitted from ./en/functions/url.xml, last change in rev 1.2 -->
<refentry id="function.urldecode">
<refnamediv>
<refname>urldecode</refname>
<refpurpose>½âÂëÒѱàÂëµÄ URL ×Ö·û´®</refpurpose>
</refnamediv>
<refsect1>
<title>ÃèÊö</title>
<methodsynopsis>
<type>string</type><methodname>urldecode</methodname>
<methodparam><type>string</type><parameter>str</parameter></methodparam>
</methodsynopsis>
<para>
½âÂë¸ø³öµÄÒѱàÂë×Ö·û´®ÖеÄÈκÎ
<literal>%<replaceable>##</replaceable></literal>¡£·µ»Ø½âÂëºóµÄ×Ö·û´®¡£
<example>
<title><function>urldecode</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$a = explode('&', $QUERY_STRING);
$i = 0;
while ($i < count($a)) {
$b = split('=', $a[$i]);
echo 'Value for parameter ', htmlspecialchars(urldecode($b[0])),
' is ', htmlspecialchars(urldecode($b[1])), "<br />\n";
$i++;
}
?>
]]>
</programlisting>
</example>
</para>
<para>
²Î¼û
<function>urlencode</function>¡¢<function>rawurlencode</function>
Óë <function>rawurldecode</function>¡£
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
Index: phpdoc-zh/reference/url/functions/urlencode.xml
+++ phpdoc-zh/reference/url/functions/urlencode.xml
<?xml version="1.0" encoding="gb2312"?>
<!-- $Revision: 1.1 $ -->
<!-- $Author: nio $ -->
<!-- EN-Revision: 1.6 Maintainer: nio Status: ready -->
<!-- splitted from ./en/functions/url.xml, last change in rev 1.2 -->
<refentry id="function.urlencode">
<refnamediv>
<refname>urlencode</refname>
<refpurpose>±àÂë URL ×Ö·û´®</refpurpose>
</refnamediv>
<refsect1>
<title>ÃèÊö</title>
<methodsynopsis>
<type>string</type><methodname>urlencode</methodname>
<methodparam><type>string</type><parameter>str</parameter></methodparam>
</methodsynopsis>
<para>
·µ»Ø×Ö·û´®£¬´Ë×Ö·û´®ÖгýÁË
<literal>-_.</literal>
Ö®ÍâµÄËùÓзÇ×ÖĸÊý×Ö×Ö·û¶¼½«±»Ìæ»»³É°Ù·ÖºÅ£¨<literal>%</literal>£©ºó¸úÁ½Î»Ê®Áù½øÖÆÊý£¬¿Õ¸ñÔò±àÂëΪ¼ÓºÅ£¨<literal>+</literal>£©¡£´Ë±àÂëÓë
WWW
±íµ¥ POST Êý¾ÝµÄ±àÂ뷽ʽÊÇÒ»ÑùµÄ£¬Í¬Ê±Óë
<literal>application/x-www-form-urlencoded</literal>
µÄýÌåÀàÐͱàÂ뷽ʽһÑù¡£ÓÉÓÚÀúÊ·ÔÒò£¬´Ë±àÂëÔÚ½«¿Õ¸ñ±àÂëΪ¼ÓºÅ£¨+£©·½ÃæÓë
RFC1738 ±àÂ루²Î¼û
<function>rawurlencode</function>£©²»Í¬¡£´Ëº¯Êý±ãÓÚ½«×Ö·û´®±àÂë²¢½«ÆäÓÃÓÚ
URL µÄÇëÇ󲿷֣¬Í¬Ê±Ëü»¹±ãÓÚ½«±äÁ¿´«µÝ¸øÏÂÒ»Ò³£º
<example>
<title><function>urlencode</function> ʾÀý</title>
<programlisting role="php">
<![CDATA[
<?php
echo '<a href="mycgi?foo=', urlencode($userinput), '">';
?>
]]>
</programlisting>
</example>
</para>
<para>
×¢Ò⣺СÐÄÓë HTML ʵÌåÏàÆ¥ÅäµÄ±äÁ¿¡£Ïñ
&amp¡¢&copy ºÍ &pound
¶¼½«±»ä¯ÀÀÆ÷½âÎö£¬²¢Ê¹ÓÃʵ¼ÊʵÌåÌæ´úËùÆÚ´ýµÄ±äÁ¿Ãû¡£ÕâÊÇÃ÷ÏԵĻìÂÒ£¬W3C
ÒѾ¸æ½ëÈËÃǺü¸ÄêÁË¡£²Î¿¼µØÖ·£º<ulink
url="&url.argsep;">&url.argsep;</ulink>
PHP ͨ¹ý arg_separator .ini Ö¸Á֧³Ö½«²ÎÊý·Ö¸î·û±ä³É W3C
Ëù½¨ÒéµÄ·ÖºÅ¡£²»ÐÒµÄÊÇ´ó¶àÊýÓû§´úÀí²¢²»·¢Ëͷֺŷָô·û¸ñʽµÄ±íµ¥Êý¾Ý¡£½ÏΪ¼òµ¥µÄ½â¾ö°ì·¨ÊÇʹÓÃ
&amp; ´úÌæ & ×÷Ϊ·Ö¸ô·û¡£Äã²»ÐèҪΪ´ËÐÞ¸Ä PHP
µÄ arg_separator¡£ÈÃËüÈÔΪ &£¬¶ø½öʹÓÃ
htmlentities(urlencode($data)) ¶ÔÄãµÄ URL ½øÐбàÂë¡£
</para>
<para>
<example>
<title><function>urlencode</function> Óë
<function>htmlentities</function> ʾÀý</title>
<programlisting role="php">
<![CDATA[
<?php
echo '<a href="mycgi?foo=', htmlentities(urlencode($userinput)),
'">';
?>
]]>
</programlisting>
</example>
</para>
<para>
²Î¼û
<function>urldecode</function>¡¢<function>htmlentities</function>¡¢<function>rawurldecode</function>
Óë <function>rawurlencode</function>¡£
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->