Sophie

Sophie

distrib > Mandriva > 2008.1 > i586 > by-pkgid > 703d980c580707c382b4e43e25965bc5 > files > 7703

php-manual-pt_BR-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>mb_encode_numericentity</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="Manual do PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="Multibyte String Functions"
HREF="ref.mbstring.html"><LINK
REL="PREVIOUS"
TITLE="mb_encode_mimeheader"
HREF="function.mb-encode-mimeheader.html"><LINK
REL="NEXT"
TITLE="mb_ereg_match"
HREF="function.mb-ereg-match.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></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 do PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.mb-encode-mimeheader.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.mb-ereg-match.html"
ACCESSKEY="N"
>Próxima</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.mb-encode-numericentity"
></A
>mb_encode_numericentity</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN126988"
></A
><P
>    (PHP 4 &#62;= 4.0.6, PHP 5)</P
>mb_encode_numericentity&nbsp;--&nbsp;
     Encode character to HTML numeric string reference
    </DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN126991"
></A
><H2
>Description</H2
>string <B
CLASS="methodname"
>mb_encode_numericentity</B
> ( string str, array convmap [, string encoding] )<BR
></BR
><P
>&#13;     <B
CLASS="function"
>mb_encode_numericentity()</B
> converts
     specified character codes in string <CODE
CLASS="parameter"
>str</CODE
>
     from HTML numeric character reference to character code. It
     returns converted string.
    </P
><P
>&#13;     <CODE
CLASS="parameter"
>convmap</CODE
> is array specifies code area to
     convert.
    </P
><P
>&#13;     <CODE
CLASS="parameter"
>encoding</CODE
> is character encoding.
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN127013"
></A
><P
><B
>Exemplo 1. <CODE
CLASS="parameter"
>convmap</CODE
> example</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
$convmap = array (<br /> int start_code1, int end_code1, int offset1, int mask1,<br /> int start_code2, int end_code2, int offset2, int mask2,<br /> ........<br /> int start_codeN, int end_codeN, int offsetN, int maskN );<br />// Specify Unicode value for start_codeN and end_codeN<br />// Add offsetN to value and take bit-wise 'AND' with maskN, then<br />// it converts value to numeric string reference.</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN127018"
></A
><P
><B
>Exemplo 2. 
       <B
CLASS="function"
>mb_encode_numericentity()</B
> example
      </B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br /></font><font color="#FF8000">/* Convert Left side of ISO-8859-1 to HTML numeric character reference */<br /></font><font color="#0000BB">$convmap </font><font color="#007700">= array(</font><font color="#0000BB">0x80</font><font color="#007700">, </font><font color="#0000BB">0xff</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">, </font><font color="#0000BB">0xff</font><font color="#007700">);<br /></font><font color="#0000BB">$str </font><font color="#007700">= </font><font color="#0000BB">mb_encode_numericentity</font><font color="#007700">(</font><font color="#0000BB">$str</font><font color="#007700">, </font><font color="#0000BB">$convmap</font><font color="#007700">, </font><font color="#DD0000">"ISO-8859-1"</font><font color="#007700">);<br /><br /></font><font color="#FF8000">/* Convert user defined SJIS-win code in block 95-104 to numeric<br />&nbsp;&nbsp;&nbsp;string reference */<br /></font><font color="#0000BB">$convmap </font><font color="#007700">= array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">0xe000</font><font color="#007700">, </font><font color="#0000BB">0xe03e</font><font color="#007700">, </font><font color="#0000BB">0x1040</font><font color="#007700">, </font><font color="#0000BB">0xffff</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">0xe03f</font><font color="#007700">, </font><font color="#0000BB">0xe0bb</font><font color="#007700">, </font><font color="#0000BB">0x1041</font><font color="#007700">, </font><font color="#0000BB">0xffff</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">0xe0bc</font><font color="#007700">, </font><font color="#0000BB">0xe0fa</font><font color="#007700">, </font><font color="#0000BB">0x1084</font><font color="#007700">, </font><font color="#0000BB">0xffff</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">0xe0fb</font><font color="#007700">, </font><font color="#0000BB">0xe177</font><font color="#007700">, </font><font color="#0000BB">0x1085</font><font color="#007700">, </font><font color="#0000BB">0xffff</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">0xe178</font><font color="#007700">, </font><font color="#0000BB">0xe1b6</font><font color="#007700">, </font><font color="#0000BB">0x10c8</font><font color="#007700">, </font><font color="#0000BB">0xffff</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">0xe1b7</font><font color="#007700">, </font><font color="#0000BB">0xe233</font><font color="#007700">, </font><font color="#0000BB">0x10c9</font><font color="#007700">, </font><font color="#0000BB">0xffff</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">0xe234</font><font color="#007700">, </font><font color="#0000BB">0xe272</font><font color="#007700">, </font><font color="#0000BB">0x110c</font><font color="#007700">, </font><font color="#0000BB">0xffff</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">0xe273</font><font color="#007700">, </font><font color="#0000BB">0xe2ef</font><font color="#007700">, </font><font color="#0000BB">0x110d</font><font color="#007700">, </font><font color="#0000BB">0xffff</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">0xe2f0</font><font color="#007700">, </font><font color="#0000BB">0xe32e</font><font color="#007700">, </font><font color="#0000BB">0x1150</font><font color="#007700">, </font><font color="#0000BB">0xffff</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">0xe32f</font><font color="#007700">, </font><font color="#0000BB">0xe3ab</font><font color="#007700">, </font><font color="#0000BB">0x1151</font><font color="#007700">, </font><font color="#0000BB">0xffff </font><font color="#007700">);<br /></font><font color="#0000BB">$str </font><font color="#007700">= </font><font color="#0000BB">mb_encode_numericentity</font><font color="#007700">(</font><font color="#0000BB">$str</font><font color="#007700">, </font><font color="#0000BB">$convmap</font><font color="#007700">, </font><font color="#DD0000">"sjis-win"</font><font color="#007700">);<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     See also <A
HREF="function.mb-decode-numericentity.html"
><B
CLASS="function"
>mb_decode_numericentity()</B
></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.mb-encode-mimeheader.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Principal</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.mb-ereg-match.html"
ACCESSKEY="N"
>Próxima</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>mb_encode_mimeheader</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.mbstring.html"
ACCESSKEY="U"
>Acima</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>mb_ereg_match</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>