2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2002-07-30 09:25:35 +00:00
|
|
|
<!-- $Revision: 1.3 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<!-- splitted from ./en/functions/url.xml, last change in rev 1.6 -->
|
|
|
|
<refentry id="function.rawurlencode">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>rawurlencode</refname>
|
2002-07-30 09:25:35 +00:00
|
|
|
<refpurpose>URL-encode according to RFC 1738</refpurpose>
|
2002-04-15 00:12:54 +00:00
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>string</type><methodname>rawurlencode</methodname>
|
|
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
Returns a string in which all non-alphanumeric characters except
|
|
|
|
<screen>-_.</screen> have been replaced with a percent
|
|
|
|
(<literal>%</literal>) sign followed by two hex digits. This is
|
2002-07-30 09:25:35 +00:00
|
|
|
the encoding described in RFC 1738 for protecting literal
|
2002-04-15 00:12:54 +00:00
|
|
|
characters from being interpreted as special URL delimiters, and
|
|
|
|
for protecting URL's from being mangled by transmission media
|
2002-07-30 09:25:35 +00:00
|
|
|
with character conversions (like some email systems). For
|
2002-04-15 00:12:54 +00:00
|
|
|
example, if you want to include a password in an FTP URL:
|
|
|
|
</para>
|
|
|
|
<example>
|
|
|
|
<title><function>rawurlencode</function> example 1</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
echo '<a href="ftp://user:', rawurlencode('foo @+%/'),
|
|
|
|
'@ftp.my.com/x.txt">';
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
<para>
|
|
|
|
Or, if you pass information in a PATH_INFO component of the URL:
|
|
|
|
</para>
|
|
|
|
<example>
|
|
|
|
<title><function>rawurlencode</function> example 2</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
echo '<a href="http://x.com/department_list_script/',
|
|
|
|
rawurlencode('sales and marketing/Miami'), '">';
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
<simpara>
|
|
|
|
See also <function>rawurldecode</function>,
|
|
|
|
<function>urldecode</function>,
|
2002-07-30 09:25:35 +00:00
|
|
|
<function>urlencode</function> and
|
|
|
|
<ulink url="&url.rfc;rfc1738.html">RFC 1738</ulink>
|
2002-04-15 00:12:54 +00:00
|
|
|
</simpara>
|
|
|
|
</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
|
|
|
|
-->
|