cvs: phpdoc /en/functions mbstring.xml

From: Date: Sun, 10 Mar 2002 08:51:50 +0000
Subject: cvs: phpdoc /en/functions mbstring.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969342905@lists.php.net to get a copy of this message
hirokawa Sun Mar 10 03:51:50 2002 EDT Modified files: /phpdoc/en/functions mbstring.xml Log: added description about function overload. Index: phpdoc/en/functions/mbstring.xml diff -u phpdoc/en/functions/mbstring.xml:1.23 phpdoc/en/functions/mbstring.xml:1.24 --- phpdoc/en/functions/mbstring.xml:1.23 Sat Mar 9 18:32:04 2002 +++ phpdoc/en/functions/mbstring.xml Sun Mar 10 03:51:50 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.23 $ --> +<!-- $Revision: 1.24 $ --> <reference id="ref.mbstring"> <title>Multi-Byte String Functions</title> <titleabbrev>Multi-Byte String</titleabbrev> @@ -438,6 +438,109 @@ ]]> </programlisting> </example> + </para> + </sect2> + + <sect2 id="mb-overload"> + <title> + Overload of PHP string functions by mbstring functions with + multibyte support + </title> + <para> + Because almost PHP application written for language using + single-byte character encoding, there are some difficulties for + multibyte string handling including japanese. Almost PHP string + functions such as <function>substr</function> do not support + multibyte string. + </para> + <para> + Multibyte extension (mbstring) has some PHP string functions + with multibyte support (ex. <function>substr</function> supports + <function>mb_substr</function>). + </para> + <para> + Multibyte extension (mbstring) also supports 'function + overloading' to add multibyte string functionality without + code modification. Using function overloading, some PHP string + functions will be oveloaded multibyte string functions. + For example, <function>mb_substr</function> is called + instead of <function>substr</function> if function overloading + is enabled. Function overload makes easy to port application + supporting only single-byte encoding for multibyte application. + </para> + <para> + <literal>mbstring.func_overload</literal> in php.ini should be + set some positive value to use function overloading. + The value should specify the category of overloading functions, + sbould be set 1 to enable mail function overloading. 2 to enable + string functions, 4 to regular expression functions. For + example, if is set for 7, mail, strings, regex functions should + be overloaded. The list of overloaded functions are shown in + below. + <table> + <title>Functions to be overloaded</title> + <tgroup cols="3"> + <thead> + <row> + <entry>value of mbstring.func_overload</entry> + <entry>original function</entry> + <entry>overloaded function</entry> + </row> + </thead> + <tbody> + <row> + <entry>1</entry> + <entry><function>mail</function></entry> + <entry><function>mb_send_mail</function></entry> + </row> + <row> + <entry>2</entry> + <entry><function>strlen</function></entry> + <entry><function>mb_strlen</function></entry> + </row> + <row> + <entry>2</entry> + <entry><function>strpos</function></entry> + <entry><function>mb_strpos</function></entry> + </row> + <row> + <entry>2</entry> + <entry><function>strrpos</function></entry> + <entry><function>mb_strrpos</function></entry> + </row> + <row> + <entry>2</entry> + <entry><function>substr</function></entry> + <entry><function>mb_substr</function></entry> + </row> + <row> + <entry>4</entry> + <entry><function>ereg</function></entry> + <entry><function>mb_ereg</function></entry> + </row> + <row> + <entry>4</entry> + <entry><function>eregi</function></entry> + <entry><function>mb_eregi</function></entry> + </row> + <row> + <entry>4</entry> + <entry><function>ereg_replace</function></entry> + <entry><function>mb_ereg_replace</function></entry> + </row> + <row> + <entry>4</entry> + <entry><function>eregi_replace</function></entry> + <entry><function>mb_eregi_replace</function></entry> + </row> + <row> + <entry>4</entry> + <entry><function>split</function></entry> + <entry><function>mb_split</function></entry> + </row> + </tbody> + </tgroup> + </table> </para> </sect2>

« previous php.doc (#969342905) next »