<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >rawurlencode</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="Manual PHP" HREF="index.html"><LINK REL="UP" TITLE="URL Functions" HREF="ref.url.html"><LINK REL="PREVIOUS" TITLE="rawurldecode" HREF="function.rawurldecode.html"><LINK REL="NEXT" TITLE="urldecode" HREF="function.urldecode.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-2"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.rawurldecode.html" ACCESSKEY="P" >Înapoi</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.urldecode.html" ACCESSKEY="N" >Înainte</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.rawurlencode" ></A >rawurlencode</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN120467" ></A ><P > (PHP 3, PHP 4 , PHP 5)</P >rawurlencode -- URL-encode according to RFC 1738</DIV ><DIV CLASS="refsect1" ><A NAME="AEN120470" ></A ><H2 >Description</H2 >string <B CLASS="methodname" >rawurlencode</B > ( string str)<BR ></BR ><P > Returns a string in which all non-alphanumeric characters except <VAR CLASS="literal" >-_.</VAR > have been replaced with a percent (<VAR CLASS="literal" >%</VAR >) sign followed by two hex digits. This is the encoding described in RFC 1738 for protecting literal characters from being interpreted as special URL delimiters, and for protecting URL's from being mangled by transmission media with character conversions (like some email systems). For example, if you want to include a password in an FTP URL: </P ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN120482" ></A ><P ><B >Exemplu 1. <B CLASS="function" >rawurlencode()</B > example 1</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br /></font><font color="#007700">echo </font><font color="#DD0000">'<a href="ftp://user:'</font><font color="#007700">, </font><font color="#0000BB">rawurlencode</font><font color="#007700">(</font><font color="#DD0000">'foo @+%/'</font><font color="#007700">),<br /> </font><font color="#DD0000">'@ftp.example.com/x.txt">'</font><font color="#007700">;<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ><P > Or, if you pass information in a PATH_INFO component of the URL: </P ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN120488" ></A ><P ><B >Exemplu 2. <B CLASS="function" >rawurlencode()</B > example 2</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br /></font><font color="#007700">echo </font><font color="#DD0000">'<a href="http://example.com/department_list_script/'</font><font color="#007700">,<br /> </font><font color="#0000BB">rawurlencode</font><font color="#007700">(</font><font color="#DD0000">'sales and marketing/Miami'</font><font color="#007700">), </font><font color="#DD0000">'">'</font><font color="#007700">;<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ><P > See also <A HREF="function.rawurldecode.html" ><B CLASS="function" >rawurldecode()</B ></A >, <A HREF="function.urldecode.html" ><B CLASS="function" >urldecode()</B ></A >, <A HREF="function.urlencode.html" ><B CLASS="function" >urlencode()</B ></A > and <A HREF="http://www.faqs.org/rfcs/rfc1738" TARGET="_top" >RFC 1738</A >. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.rawurldecode.html" ACCESSKEY="P" >Înapoi</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Acasã</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.urldecode.html" ACCESSKEY="N" >Înainte</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >rawurldecode</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.url.html" ACCESSKEY="U" >Sus</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >urldecode</TD ></TR ></TABLE ></DIV ></BODY ></HTML >