mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-17 01:18:55 +00:00

removing the others git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78562 c90b9560-bf6c-de11-be94-00142212c4b1
2595 lines
86 KiB
XML
2595 lines
86 KiB
XML
<!-- D O N O T E D I T T H I S F I L E ! ! !
|
|
|
|
it is still here for historical reasons only
|
|
(as translators may need to check old revision diffs)
|
|
|
|
if you want to change things documented in this file
|
|
you should now edit the files found under en/reference
|
|
instead -->
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.27 $ -->
|
|
<reference id="ref.mbstring">
|
|
<title>Multi-Byte String Functions</title>
|
|
<titleabbrev>Multi-Byte String</titleabbrev>
|
|
<partintro>
|
|
<sect1 id="mb-intro">
|
|
<title>Introduction</title>
|
|
<para>
|
|
There are many languages in which all characters can be expressed
|
|
by single byte. Multi-byte character codes are used to express
|
|
many characters for many languages. <literal>mbstring</literal>
|
|
is developed to handle Japanese characters. However, many
|
|
<literal>mbstring</literal> functions are able to handle
|
|
character encoding other than Japanese.
|
|
</para>
|
|
<para>
|
|
A multi-byte character encoding represents single character with
|
|
consecutive bytes. Some character encoding has shift(escape)
|
|
sequences to start/end multi-byte character strings. Therefore, a
|
|
multi-byte character string may be destroyed when it is divided
|
|
and/or counted unless multi-byte character encoding safe method
|
|
is used. This module provides multi-byte character safe string
|
|
functions and other utility functions such as conversion
|
|
functions.
|
|
</para>
|
|
<para>
|
|
Since PHP is basically designed for ISO-8859-1, some multi-byte
|
|
character encoding does not work well with PHP. Therefore, it is
|
|
important to set <literal>mbstring.internal_encoding</literal> to
|
|
a character encoding that works with PHP.
|
|
</para>
|
|
<para>
|
|
PHP4 Character Encoding Requirements
|
|
</para>
|
|
<para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
Per byte encoding
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Single byte characters in range of <literal>00h-7fh</literal>
|
|
which is compatible with <literal>ASCII</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Multi-byte characters without <literal>00h-7fh</literal>
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
These are examples of internal character encoding that works with
|
|
PHP and does NOT work with PHP.
|
|
<informalexample>
|
|
<programlisting>
|
|
<![CDATA[
|
|
Character encodings work with PHP:
|
|
ISO-8859-*, EUC-JP, UTF-8
|
|
|
|
|
|
Character encodings do NOT work with PHP:
|
|
JIS, SJIS
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<para>
|
|
Character encoding, that does not work with PHP, may be converted
|
|
with <literal>mbstring</literal>'s HTTP input/output conversion
|
|
feature/function.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
SJIS should not be used for internal encoding unless the reader
|
|
is familiar with parser/compiler, character encoding and
|
|
character encoding issues.
|
|
</para>
|
|
</note>
|
|
<note>
|
|
<para>
|
|
If you use database with PHP, it is recommended that you use the
|
|
same character encoding for both database and <literal>internal
|
|
encoding</literal> for ease of use and better performance.
|
|
</para>
|
|
<para>
|
|
If you are using PostgreSQL, it supports character
|
|
encoding that is different from backend character encoding. See
|
|
the PostgreSQL manual for details.
|
|
</para>
|
|
</note>
|
|
|
|
<sect2 id="mb-enable">
|
|
<title>How to Enable mbstring</title>
|
|
<para>
|
|
<literal>mbstring</literal> is an extended module. You must
|
|
enable module with <literal>configure</literal> script. Refer
|
|
to the <link linkend="installation">Install</link> section for
|
|
details.
|
|
</para>
|
|
<simpara>
|
|
The following configure options are related to
|
|
<literal>mbstring</literal> module.
|
|
</simpara>
|
|
<para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>
|
|
<option role="configure">--enable-mbstring</option> : Enable
|
|
<literal>mbstring</literal> functions. This option is
|
|
required to use <literal>mbstring</literal> functions.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<option role="configure">--enable-mbstr-enc-trans</option> :
|
|
Enable HTTP input character encoding conversion using
|
|
<literal>mbstring</literal> conversion engine. If this
|
|
feature is enabled, HTTP input character encoding may be
|
|
converted to <literal>mbstring.internal_encoding</literal>
|
|
automatically.
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 id="mb-conv">
|
|
<title>HTTP Input and Output</title>
|
|
<para>
|
|
HTTP input/output character encoding conversion may convert
|
|
binary data also. Users are supposed to control character
|
|
encoding conversion if binary data is used for HTTP
|
|
input/output.
|
|
</para>
|
|
<para>
|
|
If <literal>enctype</literal> for HTML form is set to
|
|
<literal>multipart/form-data</literal>,
|
|
<literal>mbstring</literal> does not convert character encoding
|
|
in POST data. If it is the case, strings are needed to be
|
|
converted to internal character encoding.
|
|
</para>
|
|
<para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
HTTP Input
|
|
</simpara>
|
|
<para> There is no way to control HTTP input character
|
|
conversion from PHP script. To disable HTTP input character
|
|
conversion, it has to be done in &php.ini;.
|
|
<example>
|
|
<title>
|
|
Disable HTTP input conversion in &php.ini;
|
|
</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
;; Disable HTTP Input conversion
|
|
mbstring.http_input = pass
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
When using PHP as an Apache module, it is possible to
|
|
override PHP ini setting per Virtual Host in
|
|
<literal>httpd.conf</literal> or per directory with
|
|
<literal>.htaccess</literal>. Refer to the <link
|
|
linkend="configuration">Configuration</link> section and
|
|
Apache Manual for details.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
HTTP Output
|
|
</simpara>
|
|
<para>
|
|
There are several ways to enable output character encoding
|
|
conversion. One is using &php.ini;, another
|
|
is using <function>ob_start</function> with
|
|
<function>mb_output_handler</function> as
|
|
<literal>ob_start</literal> callback function.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
For PHP3-i18n users, <literal>mbstring</literal>'s output
|
|
conversion differs from PHP3-i18n. Character encoding is
|
|
converted using output buffer.
|
|
</para>
|
|
</note>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>&php.ini; setting example</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
;; Enable output character encoding conversion for all PHP pages
|
|
|
|
;; Enable Output Buffering
|
|
output_buffering = On
|
|
|
|
;; Set mb_output_handler to enable output conversion
|
|
output_handler = mb_output_handler
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Script example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// Enable output character encoding conversion only for this page
|
|
|
|
// Set HTTP output character encoding to SJIS
|
|
mb_http_output('SJIS');
|
|
|
|
// Start buffering and specify "mb_output_handler" as
|
|
// callback function
|
|
ob_start('mb_output_handler');
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 id="mb-code">
|
|
<title>Supported Character Encoding</title>
|
|
<simpara>
|
|
Currently, the following character encoding is supported by
|
|
<literal>mbstring</literal> module. Caracter encoding may
|
|
be specified for <literal>mbstring</literal> functions'
|
|
<literal>encoding</literal> parameter. </simpara>
|
|
<para>
|
|
The following character encoding is supported in this PHP
|
|
extension :
|
|
</para>
|
|
<para>
|
|
<literal>UCS-4</literal>, <literal>UCS-4BE</literal>,
|
|
<literal>UCS-4LE</literal>, <literal>UCS-2</literal>,
|
|
<literal>UCS-2BE</literal>, <literal>UCS-2LE</literal>,
|
|
<literal>UTF-32</literal>, <literal>UTF-32BE</literal>,
|
|
<literal>UTF-32LE</literal>, <literal>UCS-2LE</literal>,
|
|
<literal>UTF-16</literal>, <literal>UTF-16BE</literal>,
|
|
<literal>UTF-16LE</literal>, <literal>UTF-8</literal>,
|
|
<literal>UTF-7</literal>, <literal>ASCII</literal>,
|
|
<literal>EUC-JP</literal>, <literal>SJIS</literal>,
|
|
<literal>eucJP-win</literal>, <literal>SJIS-win</literal>,
|
|
<literal>ISO-2022-JP</literal>, <literal>JIS</literal>,
|
|
<literal>ISO-8859-1</literal>, <literal>ISO-8859-2</literal>,
|
|
<literal>ISO-8859-3</literal>, <literal>ISO-8859-4</literal>,
|
|
<literal>ISO-8859-5</literal>, <literal>ISO-8859-6</literal>,
|
|
<literal>ISO-8859-7</literal>, <literal>ISO-8859-8</literal>,
|
|
<literal>ISO-8859-9</literal>, <literal>ISO-8859-10</literal>,
|
|
<literal>ISO-8859-13</literal>, <literal>ISO-8859-14</literal>,
|
|
<literal>ISO-8859-15</literal>, <literal>byte2be</literal>,
|
|
<literal>byte2le</literal>, <literal>byte4be</literal>,
|
|
<literal>byte4le</literal>, <literal>BASE64</literal>,
|
|
<literal>7bit</literal>, <literal>8bit</literal> and
|
|
<literal>UTF7-IMAP</literal>.
|
|
</para>
|
|
<para>
|
|
&php.ini; entry, which accepts encoding name,
|
|
accepts "<literal>auto</literal>" and
|
|
"<literal>pass</literal>" also.
|
|
<literal>mbstring</literal> functions, which accepts encoding
|
|
name, and accepts "<literal>auto</literal>".
|
|
</para>
|
|
<para>
|
|
If "<literal>pass</literal>" is set, no character
|
|
encoding conversion is performed.
|
|
</para>
|
|
<para>
|
|
If "<literal>auto</literal>" is set, it is expanded to
|
|
"<literal>ASCII,JIS,UTF-8,EUC-JP,SJIS</literal>".
|
|
</para>
|
|
<para>
|
|
See also <function>mb_detect_order</function>
|
|
</para>
|
|
<note>
|
|
<para>
|
|
"Supported character encoding" does not mean that it
|
|
works as internal character code.
|
|
</para>
|
|
</note>
|
|
</sect2>
|
|
|
|
<sect2 id="mb-ini">
|
|
<title>&php.ini; settings</title>
|
|
<para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>mbstring.internal_encoding</literal> defines default
|
|
internal character encoding.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>mbstring.http_input</literal> defines default HTTP
|
|
input character encoding.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>mbstring.http_output</literal> defines default HTTP
|
|
output character encoding.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>mbstring.detect_order</literal> defines default
|
|
character code detection order. See also
|
|
<function>mb_detect_order</function>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>mbstring.substitute_character</literal> defines
|
|
character to substitute for invalid character encoding.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
Web Browsers are supposed to use the same character encoding
|
|
when submitting form. However, browsers may not use the same
|
|
character encoding. See <function>mb_http_input</function> to
|
|
detect character encoding used by browsers.
|
|
</para>
|
|
<para>
|
|
If <literal>enctype</literal> is set to
|
|
<literal>multipart/form-data</literal> in HTML forms,
|
|
<literal>mbstring</literal> does not convert character encoding
|
|
in POST data. The user must convert them in the script, if
|
|
conversion is needed.
|
|
</para>
|
|
<para>
|
|
Although, browsers are smart enough to detect character encoding
|
|
in HTML. <literal>charset</literal> is better to be set in HTTP
|
|
header. Change <literal>default_charset</literal> according to
|
|
character encoding.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>&php.ini; setting example</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
;; Set default internal encoding
|
|
;; Note: Make sure to use character encoding works with PHP
|
|
mbstring.internal_encoding = UTF-8 ; Set internal encoding to UTF-8
|
|
|
|
;; Set default HTTP input character encoding
|
|
;; Note: Script cannot change http_input setting.
|
|
mbstring.http_input = pass ; No conversion.
|
|
mbstring.http_input = auto ; Set HTTP input to auto
|
|
; "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS"
|
|
mbstring.http_input = SJIS ; Set HTTP2 input to SJIS
|
|
mbstring.http_input = UTF-8,SJIS,EUC-JP ; Specify order
|
|
|
|
;; Set default HTTP output character encoding
|
|
mbstring.http_output = pass ; No conversion
|
|
mbstring.http_output = UTF-8 ; Set HTTP output encoding to UTF-8
|
|
|
|
;; Set default character encoding detection order
|
|
mbstring.detect_order = auto ; Set detect order to auto
|
|
mbstring.detect_order = ASCII,JIS,UTF-8,SJIS,EUC-JP ; Specify order
|
|
|
|
;; Set default substitute character
|
|
mbstring.substitute_character = 12307 ; Specify Unicode value
|
|
mbstring.substitute_character = none ; Do not print character
|
|
mbstring.substitute_character = long ; Long Example: U+3000,JIS+7E7E
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>&php.ini; setting for <literal>EUC-JP</literal> users</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
;; Disable Output Buffering
|
|
output_buffering = Off
|
|
|
|
;; Set HTTP header charset
|
|
default_charset = EUC-JP
|
|
|
|
;; Set HTTP input encoding conversion to auto
|
|
mbstring.http_input = auto
|
|
|
|
;; Convert HTTP output to EUC-JP
|
|
mbstring.http_output = EUC-JP
|
|
|
|
;; Set internal encoding to EUC-JP
|
|
mbstring.internal_encoding = EUC-JP
|
|
|
|
;; Do not print invalid characters
|
|
mbstring.substitute_character = none
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>&php.ini; setting for <literal>SJIS</literal> users</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
;; Enable Output Buffering
|
|
output_buffering = On
|
|
|
|
;; Set mb_output_handler to enable output conversion
|
|
output_handler = mb_output_handler
|
|
|
|
;; Set HTTP header charset
|
|
default_charset = Shift_JIS
|
|
|
|
;; Set http input encoding conversion to auto
|
|
mbstring.http_input = auto
|
|
|
|
;; Convert to SJIS
|
|
mbstring.http_output = SJIS
|
|
|
|
;; Set internal encoding to EUC-JP
|
|
mbstring.internal_encoding = EUC-JP
|
|
|
|
;; Do not print invalid characters
|
|
mbstring.substitute_character = none
|
|
]]>
|
|
</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>
|
|
|
|
<sect2 id="mb-ja-basic">
|
|
<title>Basics for Japanese multi-byte character</title>
|
|
<para>
|
|
Most Japanese characters need more than 1 byte per character. In
|
|
addition, several character encoding schemas are used under a
|
|
Japanese environment. There are EUC-JP, Shift_JIS(SJIS) and
|
|
ISO-2022-JP(JIS) character encoding. As Unicode becomes popular,
|
|
UTF-8 is used also. To develop Web applications for a Japanese
|
|
environment, it is important to use the character set for the
|
|
task in hand, whether HTTP input/output, RDBMS and E-mail.
|
|
</para>
|
|
<para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>Storage for a character can be up to six
|
|
bytes</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
A multi-byte character is usually twice of the width compared
|
|
to single-byte characters. Wider characters are called
|
|
"zen-kaku" - meaning full width, narrower characters are
|
|
called "han-kaku" - meaning half width. "zen-kaku" characters
|
|
are usually fixed width.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Some character encoding defines shift(escape) sequence for
|
|
entering/exiting multi-byte character strings.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
ISO-2022-JP must be used for SMTP/NNTP.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
"i-mode" web site is supposed to use SJIS.
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 id="mb-ref">
|
|
<title>References</title>
|
|
<para>
|
|
Multi-byte character encoding and its related issues are very
|
|
complex. It is impossible to cover in sufficient detail
|
|
here. Please refer to the following URLs and other resources for
|
|
further readings.
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>
|
|
Unicode/UTF/UCS/etc
|
|
</para>
|
|
<para>
|
|
<literal>http://www.unicode.org/</literal>
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
Japanese/Korean/Chinese character
|
|
information
|
|
</para>
|
|
<para>
|
|
<literal>
|
|
ftp://ftp.ora.com/pub/examples/nutshell/ujip/doc/cjk.inf
|
|
</literal>
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</sect2>
|
|
|
|
</sect1>
|
|
</partintro>
|
|
|
|
<refentry id="function.mb-language">
|
|
<refnamediv>
|
|
<refname>mb_language</refname>
|
|
<refpurpose>
|
|
Set/Get current language
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_language</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>language</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_language</function> sets language. If
|
|
<parameter>language</parameter> is omitted, it returns current
|
|
language as string.
|
|
</para>
|
|
<para>
|
|
<parameter>language</parameter> setting is used for encoding
|
|
e-mail messages. Valid languages are "Japanese",
|
|
"ja","English","en" and "uni"
|
|
(UTF-8). <function>mb_send_mail</function> uses this setting to
|
|
encode e-mail.
|
|
</para>
|
|
<para> Language and its setting is ISO-2022-JP/Base64 for
|
|
Japanese, UTF-8/Base64 for uni, ISO-8859-1/quoted printable for
|
|
English.
|
|
</para>
|
|
<para>
|
|
Return Value: If <parameter>language</parameter> is set and
|
|
<parameter>language</parameter> is valid, it returns
|
|
&true;. Otherwise, it returns &false;. When
|
|
<parameter>language</parameter> is omitted, it returns language
|
|
name as string. If no language is set previously, it returns
|
|
&false;.
|
|
</para>
|
|
<para>
|
|
See also <function>mb_send_mail</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-parse-str">
|
|
<refnamediv>
|
|
<refname>mb_parse_str</refname>
|
|
<refpurpose>
|
|
Parse GET/POST/COOKIE data and set global variable
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>boolean</type><methodname>mb_parse_str</methodname>
|
|
<methodparam><type>string</type><parameter>encoded_string</parameter></methodparam>
|
|
<methodparam choice="opt"><type>array</type><parameter>result</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_parse_str</function> parses GET/POST/COOKIE data and
|
|
sets global variables. Since PHP does not provide raw POST/COOKIE
|
|
data, it can only used for GET data for now. It preses URL
|
|
encoded data, detects encoding, converts coding to internal
|
|
encoding and set values to <parameter>result</parameter> array or
|
|
global variables.
|
|
</para>
|
|
<para>
|
|
<parameter>encoded_string</parameter>: URL encoded data.
|
|
</para>
|
|
<para>
|
|
<parameter>result</parameter>: Array contains decoded and
|
|
character encoding converted values.
|
|
</para>
|
|
<para>
|
|
Return Value: It returns &true; for success or &false; for failure.
|
|
</para>
|
|
<para>
|
|
See also <function>mb_detect_order</function>,
|
|
<function>mb_internal_encoding</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-internal-encoding">
|
|
<refnamediv>
|
|
<refname>mb_internal_encoding</refname>
|
|
<refpurpose>
|
|
Set/Get internal character encoding
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_internal_encoding</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_internal_encoding</function> sets internal character
|
|
encoding to <parameter>encoding</parameter> If parameter is
|
|
omitted, it returns current internal encoding.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter> is used for HTTP input character
|
|
encoding conversion, HTTP output character encoding conversion
|
|
and default character encoding for string functions defined by
|
|
mbstring module.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter>: Character encoding name
|
|
</para>
|
|
<para>
|
|
Return Value: If <parameter>encoding</parameter> is
|
|
set,<function>mb_internal_encoding</function> returns
|
|
&true; for success, otherwise returns
|
|
&false;. If <parameter>encoding</parameter> is
|
|
omitted, it returns current character encoding name.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>mb_internal_encoding</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
/* Set internal character encoding to UTF-8 */
|
|
mb_internal_encoding("UTF-8");
|
|
|
|
/* Display current internal character encoding */
|
|
echo mb_internal_encoding();
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also <function>mb_http_input</function>,
|
|
<function>mb_http_output</function>,
|
|
<function>mb_detect_order</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-http-input">
|
|
<refnamediv>
|
|
<refname>mb_http_input</refname>
|
|
<refpurpose>Detect HTTP input character encoding</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_http_input</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>type</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
<function>mb_http_input</function> returns result of HTTP input
|
|
character encoding detection.
|
|
</simpara>
|
|
<para>
|
|
<parameter>type</parameter>: Input string specifies input
|
|
type. "G" for GET, "P" for POST,
|
|
"C" for COOKIE. If type is omitted, it returns last
|
|
input type processed.
|
|
</para>
|
|
<para>
|
|
Return Value: Character encoding name.
|
|
If <function>mb_http_input</function> does not process specified
|
|
HTTP input, it returns &false;.
|
|
</para>
|
|
<para>
|
|
See also <function>mb_internal_encoding</function>,
|
|
<function>mb_http_output</function>,
|
|
<function>mb_detect_order</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-http-output">
|
|
<refnamediv>
|
|
<refname>mb_http_output</refname>
|
|
<refpurpose>Set/Get HTTP output character encoding</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_http_output</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
If <parameter>encoding</parameter> is set,
|
|
<function>mb_http_output</function> sets HTTP output character
|
|
encoding to <parameter>encoding</parameter>. Output after this
|
|
function is converted to <parameter>encoding</parameter>.
|
|
<function>mb_http_output</function> returns
|
|
&true; for success and &false;
|
|
for failure.
|
|
</para>
|
|
<para>
|
|
If <parameter>encoding</parameter> is omitted,
|
|
<function>mb_http_output</function> returns current HTTP output
|
|
character encoding.
|
|
</para>
|
|
<para>
|
|
See also <function>mb_internal_encoding</function>,
|
|
<function>mb_http_input</function>,
|
|
<function>mb_detect_order</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-detect-order">
|
|
<refnamediv>
|
|
<refname>mb_detect_order</refname>
|
|
<refpurpose>
|
|
Set/Get character encoding detection order
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>mb_detect_order</methodname>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>encoding-list</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_detect_order</function> sets automatic character
|
|
encoding detection order to <parameter>encoding-list</parameter>.
|
|
It returns &true; for success,
|
|
&false; for failure.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding-list</parameter> is array or comma separated
|
|
list of character encoding. ("auto" is expanded to
|
|
"ASCII, JIS, UTF-8, EUC-JP, SJIS")
|
|
</para>
|
|
<para>
|
|
If <parameter>encoding-list</parameter> is omitted, it returns
|
|
current character encoding detection order as array.
|
|
</para>
|
|
<para>
|
|
This setting affects <function>mb_detect_encoding</function> and
|
|
<function>mb_send_mail</function>.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
<literal>mbstring</literal> currently implements following
|
|
encoding detection filters. If there is a invalid byte sequence
|
|
for following encoding, encoding detection will fail.
|
|
</para>
|
|
<simpara>
|
|
<literal>UTF-8</literal>, <literal>UTF-7</literal>,
|
|
<literal>ASCII</literal>,
|
|
<literal>EUC-JP</literal>,<literal>SJIS</literal>,
|
|
<literal>eucJP-win</literal>, <literal>SJIS-win</literal>,
|
|
<literal>JIS</literal>, <literal>ISO-2022-JP</literal>
|
|
</simpara>
|
|
<para>
|
|
For <literal>ISO-8859-*</literal>, <literal>mbstring</literal>
|
|
always detects as <literal>ISO-8859-*</literal>.
|
|
</para>
|
|
<para>
|
|
For <literal>UTF-16</literal>, <literal>UTF-32</literal>,
|
|
<literal>UCS2</literal> and <literal>UCS4</literal>, encoding
|
|
detection will fail always.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Useless detect order example</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
; Always detect as ISO-8859-1
|
|
detect_order = ISO-8859-1, UTF-8
|
|
|
|
; Always detect as UTF-8, since ASCII/UTF-7 values are
|
|
; valid for UTF-8
|
|
detect_order = UTF-8, ASCII, UTF-7
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</note>
|
|
<para>
|
|
<example>
|
|
<title><function>mb_detect_order</function> examples</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
/* Set detection order by enumerated list */
|
|
mb_detect_order("eucjp-win,sjis-win,UTF-8");
|
|
|
|
/* Set detection order by array */
|
|
$ary[] = "ASCII";
|
|
$ary[] = "JIS";
|
|
$ary[] = "EUC-JP";
|
|
mb_detect_order($ary);
|
|
|
|
/* Display current detection order */
|
|
echo implode(", ", mb_detect_order());
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also <function>mb_internal_encoding</function>,
|
|
<function>mb_http_input</function>,
|
|
<function>mb_http_output</function>
|
|
<function>mb_send_mail</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-substitute-character">
|
|
<refnamediv>
|
|
<refname>mb_substitute_character</refname>
|
|
<refpurpose>Set/Get substitution character</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>mixed</type><methodname>mb_substitute_character</methodname>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>substrchar</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_substitute_character</function> specifies
|
|
substitution character when input character encoding is invalid
|
|
or character code is not exist in output character
|
|
encoding. Invalid characters may be substituted &null;(no output),
|
|
string or integer value (Unicode character code value).
|
|
</para>
|
|
<para>
|
|
This setting affects <function>mb_detect_encoding</function>
|
|
and <function>mb_send_mail</function>.
|
|
</para>
|
|
<para>
|
|
<parameter>substchar</parameter> : Specify Unicode value as
|
|
integer or specify as string as follows
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
"none" : no output
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"long" : Output character code value (Example:
|
|
U+3000,JIS+7E7E)
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
Return Value: If <parameter>substchar</parameter> is set, it
|
|
returns &true; for success, otherwise returns
|
|
&false;. If <parameter>substchar</parameter> is
|
|
not set, it returns Unicode value or
|
|
"<literal>none</literal>"/"<literal>long</literal>".
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>mb_substitute_character</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
/* Set with Unicode U+3013 (GETA MARK) */
|
|
mb_substitute_character(0x3013);
|
|
|
|
/* Set hex format */
|
|
mb_substitute_character("long");
|
|
|
|
/* Display current setting */
|
|
echo mb_substitute_character();
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-output-handler">
|
|
<refnamediv>
|
|
<refname>mb_output_handler</refname>
|
|
<refpurpose>
|
|
Callback function converts character encoding in output buffer
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_output_handler</methodname>
|
|
<methodparam><type>string</type><parameter>contents</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>status</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_output_handler</function> is
|
|
<function>ob_start</function> callback
|
|
function. <function>mb_output_handler</function> converts
|
|
characters in output buffer from internal character encoding to
|
|
HTTP output character encoding.
|
|
</para>
|
|
<para>
|
|
4.1.0 or later version, this hanlder adds charset HTTP header
|
|
when following conditions are met:
|
|
</para>
|
|
<para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>Does not set <literal>Content-Type</literal> by
|
|
header()</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>Default MIME type begins with
|
|
<literal>text/</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>http_output</literal> setting is other than
|
|
pass</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
<parameter>contents</parameter> : Output buffer contents
|
|
</para>
|
|
<para>
|
|
<parameter>status</parameter> : Output buffer status
|
|
</para>
|
|
<para>
|
|
Return Value: String converted
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>mb_output_handler</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
mb_http_output("UTF-8");
|
|
ob_start("mb_output_handler");
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<note>
|
|
<para>
|
|
If you want to output some binary data such as image from PHP
|
|
script, you must set output encoding to "pass" using
|
|
<function>mb_http_output</function>.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also <function>ob_start</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-preferred-mime-name">
|
|
<refnamediv>
|
|
<refname>mb_preferred_mime_name</refname>
|
|
<refpurpose>Get MIME charset string</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_preferred_mime_name</methodname>
|
|
<methodparam><type>string</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_preferred_mime_name</function> returns MIME
|
|
<literal>charset</literal> string for character encoding
|
|
<parameter>encoding</parameter>. It returns
|
|
<literal>charset</literal> string.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>mb_preferred_mime_string</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
$outputenc = "sjis-win";
|
|
mb_http_output($outputenc);
|
|
ob_start("mb_output_handler");
|
|
header("Content-Type: text/html; charset=" . mb_preferred_mime_name($outputenc));
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-strlen">
|
|
<refnamediv>
|
|
<refname>mb_strlen</refname>
|
|
<refpurpose>Get string length</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_strlen</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_strlen</function> returns number of characters in
|
|
string <parameter>str</parameter> having character encoding
|
|
<parameter>encoding</parameter>. A multi-byte character is
|
|
counted as 1.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter> is character encoding for
|
|
<parameter>str</parameter>. If <parameter>encoding</parameter> is
|
|
omitted, internal character encoding is used.
|
|
</para>
|
|
<para>
|
|
See also <function>mb_internal_encoding</function>,
|
|
<function>strlen</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-strpos">
|
|
<refnamediv>
|
|
<refname>mb_strpos</refname>
|
|
<refpurpose>
|
|
Find position of first occurrence of string in a string
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>mb_strpos</methodname>
|
|
<methodparam><type>string</type><parameter>haystack</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>needle</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_strpos</function> returns the numeric position of
|
|
the first occurrence of <parameter>needle</parameter> in the
|
|
<parameter>haystack</parameter> string. If
|
|
<parameter>needle</parameter> is not found, it returns &false;.
|
|
</para>
|
|
<para>
|
|
<function>mb_strpos</function> performs multi-byte safe
|
|
<function>strpos</function> operation based on number of
|
|
characters. <parameter>needle</parameter> position is counted
|
|
from the beginning of the <parameter>haystack</parameter>. First
|
|
character's position is 0. Second character position is 1, and so
|
|
on.
|
|
</para>
|
|
<para>
|
|
If <parameter>encoding</parameter> is omitted, internal
|
|
character encoding is used. <function>mb_strrpos</function>
|
|
accepts <literal>string</literal> for
|
|
<parameter>needle</parameter> where <function>strrpos</function>
|
|
accepts only character.
|
|
</para>
|
|
<para>
|
|
<parameter>offset</parameter> is search offset. If it is not
|
|
specified, 0 is used.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter> is character encoding name. If it
|
|
is omitted, internal character encoding is used.
|
|
</para>
|
|
<para>
|
|
See also <function>mb_strpos</function>,
|
|
<function>mb_internal_encoding</function>,
|
|
<function>strpos</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-strrpos">
|
|
<refnamediv>
|
|
<refname>mb_strrpos</refname>
|
|
<refpurpose>
|
|
Find position of last occurrence of a string in a string
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>mb_strrpos</methodname>
|
|
<methodparam><type>string</type><parameter>haystack</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>needle</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_strrpos</function> returns the numeric position of
|
|
the last occurrence of <parameter>needle</parameter> in the
|
|
<parameter>haystack</parameter> string. If
|
|
<parameter>needle</parameter> is not found, it returns &false;.
|
|
</para>
|
|
<para>
|
|
<function>mb_strrpos</function> performs multi-byte safe
|
|
<function>strrpos</function> operation based on
|
|
number of characters. <parameter>needle</parameter> position is
|
|
counted from the beginning of
|
|
<parameter>haystack</parameter>. First character's position is
|
|
0. Second character position is 1.
|
|
</para>
|
|
<para>
|
|
If <parameter>encoding</parameter> is omitted, internal encoding
|
|
is assumed. <function>mb_strrpos</function> accepts
|
|
<literal>string</literal> for <parameter>needle</parameter> where
|
|
<function>strrpos</function> accepts only character.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter> is character encoding. If it is
|
|
not specified, internal character encoding is used.
|
|
</para>
|
|
<para>
|
|
See also <function>mb_strpos</function>,
|
|
<function>mb_internal_encoding</function>,
|
|
<function>strrpos</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-substr">
|
|
<refnamediv>
|
|
<refname>mb_substr</refname>
|
|
<refpurpose>Get part of string</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_substr</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>start</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_substr</function> returns the portion of
|
|
<parameter>str</parameter> specified by the
|
|
<parameter>start</parameter> and
|
|
<parameter>length</parameter> parameters.
|
|
</para>
|
|
<para>
|
|
<function>mb_substr</function> performs multi-byte safe
|
|
<function>substr</function> operation based on
|
|
number of characters. Position is
|
|
counted from the beginning of
|
|
<parameter>str</parameter>. First character's position is
|
|
0. Second character position is 1, and so on.
|
|
</para>
|
|
<para>
|
|
If <parameter>encoding</parameter> is omitted, internal encoding
|
|
is assumed.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter> is character encoding. If it is
|
|
omitted, internal character encoding is used.
|
|
</para>
|
|
<para>
|
|
See also <function>mb_strcut</function>,
|
|
<function>mb_internal_encoding</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-strcut">
|
|
<refnamediv>
|
|
<refname>mb_strcut</refname>
|
|
<refpurpose>Get part of string</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_strcut</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>start</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>length</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_strcut</function> returns the portion of
|
|
<parameter>str</parameter> specified by the
|
|
<parameter>start</parameter> and
|
|
<parameter>length</parameter> parameters.
|
|
</para>
|
|
<para>
|
|
<function>mb_strcut</function> performs equivalent operation as
|
|
<function>mb_substr</function> with different method. If
|
|
<parameter>start</parameter> position is multi-byte character's
|
|
second byte or larger, it starts from first byte of multi-byte
|
|
character.
|
|
</para>
|
|
<para>
|
|
It subtracts string from <parameter>str</parameter> that is
|
|
shorter than <parameter>length</parameter> AND character that is
|
|
not part of multi-byte string or not being middle of shift
|
|
sequence.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter> is character encoding. If it is
|
|
not set, internal character encoding is used.
|
|
</para>
|
|
<para>
|
|
See also <function>mb_substr</function>,
|
|
<function>mb_internal_encoding</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-strwidth">
|
|
<refnamediv>
|
|
<refname>mb_strwidth</refname>
|
|
<refpurpose>Return width of string</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>mb_strwidth</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_strwidth</function> returns width of string
|
|
<parameter>str</parameter>.
|
|
</para>
|
|
<para>
|
|
Multi-byte character usually twice of width compare to single
|
|
byte character.
|
|
</para>
|
|
<para>
|
|
<informalexample>
|
|
<programlisting>
|
|
<![CDATA[
|
|
Character width
|
|
|
|
U+0000 - U+0019 0
|
|
U+0020 - U+1FFF 1
|
|
U+2000 - U+FF60 2
|
|
U+FF61 - U+FF9F 1
|
|
U+FFA0 - 2
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter> is character encoding. If it is
|
|
omitted, internal encoding is used.
|
|
</para>
|
|
<para>
|
|
See also: <function>mb_strimwidth</function>,
|
|
<function>mb_internal_encoding</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-strimwidth">
|
|
<refnamediv>
|
|
<refname>mb_strimwidth</refname>
|
|
<refpurpose>Get truncated string with specified width</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_strimwidth</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>start</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>width</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>trimmarker</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_strimwidth</function> truncates string
|
|
<parameter>str</parameter> to specified
|
|
<parameter>width</parameter>. It returns truncated string.
|
|
</para>
|
|
<para>
|
|
If <parameter>trimmarker</parameter> is set,
|
|
<parameter>trimmarker</parameter> is appended to return value.
|
|
</para>
|
|
<para>
|
|
<parameter>start</parameter> is start position offset. Number of
|
|
characters from the beginning of string. (First character is 0)
|
|
</para>
|
|
<para>
|
|
<parameter>trimmarker</parameter> is string that is added to the
|
|
end of string when string is truncated.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter> is character encoding. If it is
|
|
omitted, internal encoding is used.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>mb_strimwidth</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
$str = mb_strimwidth($str, 0, 40, "..>");
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also: <function>mb_strwidth</function>,
|
|
<function>mb_internal_encoding</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-convert-encoding">
|
|
<refnamediv>
|
|
<refname>mb_convert_encoding</refname>
|
|
<refpurpose>Convert character encoding</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_convert_encoding</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>to-encoding</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>from-encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_convert_encoding</function> converts
|
|
character encoding of string <parameter>str</parameter> from
|
|
<parameter>from-encoding</parameter> to
|
|
<parameter>to-encoding</parameter>.
|
|
</para>
|
|
<para>
|
|
<parameter>str</parameter> : String to be converted.
|
|
</para>
|
|
<para>
|
|
<parameter>from-encoding</parameter> is specified by character
|
|
code name before conversion. it can be array or string - comma
|
|
separated enumerated list. If it is not specified, the internal
|
|
encoding will be used.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>mb_convert_encoding</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
/* Convert internal character encoding to SJIS */
|
|
$str = mb_convert_encoding($str, "SJIS");
|
|
|
|
/* Convert EUC-JP to UTF-7 */
|
|
$str = mb_convert_encoding($str, "UTF-7", "EUC-JP");
|
|
|
|
/* Auto detect encoding from JIS, eucjp-win, sjis-win, then convert str to UCS-2LE */
|
|
$str = mb_convert_encoding($str, "UCS-2LE", "JIS, eucjp-win, sjis-win");
|
|
|
|
/* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */
|
|
$str = mb_convert_encoding($str, "EUC-JP", "auto");
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also: <function>mb_detect_order</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-detect-encoding">
|
|
<refnamediv>
|
|
<refname>mb_detect_encoding</refname>
|
|
<refpurpose>Detect character encoding</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_detect_encoding</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>encoding-list</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_detect_encoding</function> detects character
|
|
encoding in string <parameter>str</parameter>. It returns
|
|
detected character encoding.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding-list</parameter> is list of character
|
|
encoding. Encoding order may be specified by array or comma
|
|
separated list string.
|
|
</para>
|
|
<para>
|
|
If <parameter>encoding_list</parameter> is omitted,
|
|
detect_order is used.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>mb_detect_encoding</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
/* Detect character encoding with current detect_order */
|
|
echo mb_detect_encoding($str);
|
|
|
|
/* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */
|
|
echo mb_detect_encoding($str, "auto");
|
|
|
|
/* Specify encoding_list character encoding by comma separated list */
|
|
echo mb_detect_encoding($str, "JIS, eucjp-win, sjis-win");
|
|
|
|
/* Use array to specify encoding_list */
|
|
$ary[] = "ASCII";
|
|
$ary[] = "JIS";
|
|
$ary[] = "EUC-JP";
|
|
echo mb_detect_encoding($str, $ary);
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also: <function>mb_detect_order</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-convert-kana">
|
|
<refnamediv>
|
|
<refname>mb_convert_kana</refname>
|
|
<refpurpose>
|
|
Convert "kana" one from another ("zen-kaku" ,"han-kaku" and more)
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_convert_kana</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>option</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_convert_kana</function> performs "han-kaku" -
|
|
"zen-kaku" conversion for string <parameter>str</parameter>. It
|
|
returns converted string. This function is only useful for
|
|
Japanese.
|
|
</para>
|
|
<para>
|
|
<parameter>option</parameter> is conversion option. Default value
|
|
is <literal>"KV"</literal>.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter> is character encoding. If it is
|
|
omitted, internal character encoding is used.
|
|
</para>
|
|
<para>
|
|
<informalexample>
|
|
<programlisting>
|
|
<![CDATA[
|
|
Applicable Conversion Options
|
|
|
|
option : Specify with conversion of following options. Default "KV"
|
|
"r" : Convert "zen-kaku" alphabets to "han-kaku"
|
|
"R" : Convert "han-kaku" alphabets to "zen-kaku"
|
|
"n" : Convert "zen-kaku" numbers to "han-kaku"
|
|
"N" : Convert "han-kaku" numbers to "zen-kaku"
|
|
"a" : Convert "zen-kaku" alphabets and numbers to "han-kaku"
|
|
"A" : Convert "zen-kaku" alphabets and numbers to "han-kaku"
|
|
(Characters included in "a", "A" options are
|
|
U+0021 - U+007E excluding U+0022, U+0027, U+005C, U+007E)
|
|
"s" : Convert "zen-kaku" space to "han-kaku" (U+3000 -> U+0020)
|
|
"S" : Convert "han-kaku" space to "zen-kaku" (U+0020 -> U+3000)
|
|
"k" : Convert "zen-kaku kata-kana" to "han-kaku kata-kana"
|
|
"K" : Convert "han-kaku kata-kana" to "zen-kaku kata-kana"
|
|
"h" : Convert "zen-kaku hira-gana" to "han-kaku kata-kana"
|
|
"H" : Convert "han-kaku kata-kana" to "zen-kaku hira-gana"
|
|
"c" : Convert "zen-kaku kata-kana" to "zen-kaku hira-gana"
|
|
"C" : Convert "zen-kaku hira-gana" to "zen-kaku kata-kana"
|
|
"V" : Collapse voiced sound notation and convert them into a character. Use with "K","H"
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>mb_convert_kana</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
/* Convert all "kana" to "zen-kaku" "kata-kana" */
|
|
$str = mb_convert_kana($str, "KVC");
|
|
|
|
/* Convert "han-kaku" "kata-kana" to "zen-kaku" "kata-kana"
|
|
and "zen-kaku" alpha-numeric to "han-kaku" */
|
|
$str = mb_convert_kana($str, "KVa");
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-encode-mimeheader">
|
|
<refnamediv>
|
|
<refname>mb_encode_mimeheader</refname>
|
|
<refpurpose>Encode string for MIME header</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_encode_mimeheader</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>charset</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>transfer-encoding</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>linefeed</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_encode_mimeheader</function> converts string
|
|
<parameter>str</parameter> to encoded-word for header field.
|
|
It returns converted string in ASCII encoding.
|
|
</para>
|
|
<para>
|
|
<parameter>charset</parameter> is character encoding
|
|
name. Default is <literal>ISO-2022-JP</literal>.
|
|
</para>
|
|
<para>
|
|
<parameter>transfer-encoding</parameter> is transfer encoding. It
|
|
should be one of <literal>"B"</literal> (Base64) or
|
|
<literal>"Q"</literal> (Quoted-Printable). Default is
|
|
<literal>"B"</literal>.
|
|
</para>
|
|
<para>
|
|
<parameter>linefeed</parameter> is end of line marker. Default is
|
|
<literal>"\r\n"</literal> (CRLF).
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>mb_convert_kana</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
$name = ""; // kanji
|
|
$mbox = "kru";
|
|
$doma = "gtinn.mon";
|
|
$addr = mb_encode_mimeheader($name, "UTF-7", "Q") . " <" . $mbox . "@" . $doma . ">";
|
|
echo $addr;
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also <function>mb_decode_mimeheader</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-decode-mimeheader">
|
|
<refnamediv>
|
|
<refname>mb_decode_mimeheader</refname>
|
|
<refpurpose>Decode string in MIME header field</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_decode_mimeheader</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_decode_mimeheader</function> decodes encoded-word
|
|
string <parameter>str</parameter> in MIME header.
|
|
</para>
|
|
<para>
|
|
It returns decoded string in internal character encoding.
|
|
</para>
|
|
<para>
|
|
See also <function>mb_encode_mimeheader</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-convert-variables">
|
|
<refnamediv>
|
|
<refname>mb_convert_variables</refname>
|
|
<refpurpose>Convert character code in variable(s)</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_convert_variables</methodname>
|
|
<methodparam><type>string</type><parameter>to-encoding</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>from-encoding</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>vars</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_convert_variables</function> convert
|
|
character encoding of variables <parameter>vars</parameter> in
|
|
encoding <parameter>from-encoding</parameter> to encoding
|
|
<parameter>to-encoding</parameter>. It returns character encoding
|
|
before conversion for success, &false; for failure.
|
|
</para>
|
|
<para>
|
|
<function>mb_convert_variables</function> join strings in Array
|
|
or Object to detect encoding, since encoding detection tends to
|
|
fail for short strings. Therefore, it is impossible to mix
|
|
encoding in single array or object.
|
|
</para>
|
|
<para>
|
|
It <parameter>from-encoding</parameter> is specified by
|
|
array or comma separated string, it tries to detect encoding from
|
|
<parameter>from-coding</parameter>. When
|
|
<parameter>encoding</parameter> is omitted,
|
|
<literal>detect_order</literal> is used.
|
|
</para>
|
|
<para>
|
|
<parameter>vars (3rd and larger)</parameter> is reference to
|
|
variable to be converted. String, Array and Object are accepted.
|
|
<function>mb_convert_variables</function> assumes all parameters
|
|
have the same encoding.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>mb_convert_variables</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
/* Convert variables $post1, $post2 to internal encoding */
|
|
$interenc = mb_internal_encoding();
|
|
$inputenc = mb_convert_variables($interenc, "ASCII,UTF-8,SJIS-win", $post1, $post2);
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-encode-numericentity">
|
|
<refnamediv>
|
|
<refname>mb_encode_numericentity</refname>
|
|
<refpurpose>
|
|
Encode character to HTML numeric string reference
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_encode_numericentity</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam><type>array</type><parameter>convmap</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_encode_numericentity</function> converts
|
|
specified character codes in string <parameter>str</parameter>
|
|
from HTML numeric character reference to character code. It
|
|
returns converted string.
|
|
</para>
|
|
<para>
|
|
<parameter>array</parameter> is array specifies code area to
|
|
convert.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter> is character encoding.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><parameter>convmap</parameter> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
$convmap = array (
|
|
int start_code1, int end_code1, int offset1, int mask1,
|
|
int start_code2, int end_code2, int offset2, int mask2,
|
|
........
|
|
int start_codeN, int end_codeN, int offsetN, int maskN );
|
|
// Specify Unicode value for start_codeN and end_codeN
|
|
// Add offsetN to value and take bit-wise 'AND' with maskN, then
|
|
// it converts value to numeric string reference.
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>
|
|
<function>mb_encode_numericentity</function> example
|
|
</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
/* Convert Left side of ISO-8859-1 to HTML numeric character reference */
|
|
$convmap = array(0x80, 0xff, 0, 0xff);
|
|
$str = mb_encode_numericentity($str, $convmap, "ISO-8859-1");
|
|
|
|
/* Convert user defined SJIS-win code in block 95-104 to numeric
|
|
string reference */
|
|
$convmap = array(
|
|
0xe000, 0xe03e, 0x1040, 0xffff,
|
|
0xe03f, 0xe0bb, 0x1041, 0xffff,
|
|
0xe0bc, 0xe0fa, 0x1084, 0xffff,
|
|
0xe0fb, 0xe177, 0x1085, 0xffff,
|
|
0xe178, 0xe1b6, 0x10c8, 0xffff,
|
|
0xe1b7, 0xe233, 0x10c9, 0xffff,
|
|
0xe234, 0xe272, 0x110c, 0xffff,
|
|
0xe273, 0xe2ef, 0x110d, 0xffff,
|
|
0xe2f0, 0xe32e, 0x1150, 0xffff,
|
|
0xe32f, 0xe3ab, 0x1151, 0xffff );
|
|
$str = mb_encode_numericentity($str, $convmap, "sjis-win");
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also: <function>mb_decode_numericentity</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-decode-numericentity">
|
|
<refnamediv>
|
|
<refname>mb_decode_numericentity</refname>
|
|
<refpurpose>
|
|
Decode HTML numeric string reference to character
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_decode_numericentity</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam><type>array</type><parameter>convmap</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Convert numeric string reference of string
|
|
<parameter>str</parameter> in specified block to character. It
|
|
returns converted string.
|
|
</para>
|
|
<para>
|
|
<parameter>array</parameter> is array to specifies code area to
|
|
convert.
|
|
</para>
|
|
<para>
|
|
<parameter>encoding</parameter> is character encoding. If it is
|
|
omitted, internal character encoding is used.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><parameter>convmap</parameter> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
$convmap = array (
|
|
int start_code1, int end_code1, int offset1, int mask1,
|
|
int start_code2, int end_code2, int offset2, int mask2,
|
|
........
|
|
int start_codeN, int end_codeN, int offsetN, int maskN );
|
|
// Specify Unicode value for start_codeN and end_codeN
|
|
// Add offsetN to value and take bit-wise 'AND' with maskN,
|
|
// then convert value to numeric string reference.
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also: <function>mb_encode_numericentity</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-send-mail">
|
|
<refnamediv>
|
|
<refname>mb_send_mail</refname>
|
|
<refpurpose>
|
|
Send encoded mail.
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>boolean</type><methodname>mb_send_mail</methodname>
|
|
<methodparam><type>string</type><parameter>to</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>subject</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>message</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>additional_headers</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>additional_parameter</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>mb_send_mail</function> sends email. Headers and
|
|
message are converted and encoded according to
|
|
<function>mb_language</function> setting.
|
|
<function>mb_send_mail</function> is wrapper
|
|
function of <function>mail</function>. See
|
|
<function>mail</function> for details.
|
|
</para>
|
|
<para>
|
|
<parameter>to</parameter> is mail addresses send to. Multiple
|
|
recipients can be specified by putting a comma between each
|
|
address in to. This parameter is not automatically encoded.
|
|
</para>
|
|
<para>
|
|
<parameter>subject</parameter> is subject of mail.
|
|
</para>
|
|
<para>
|
|
<parameter>message</parameter> is mail message.
|
|
</para>
|
|
<para>
|
|
<parameter>additional_headers</parameter> is inserted at
|
|
the end of the header. This is typically used to add extra
|
|
headers. Multiple extra headers are separated with a
|
|
newline ("\n").
|
|
</para>
|
|
<para>
|
|
<parameter>additional_parameter</parameter> is a MTA command line
|
|
parameter. It is useful when setting the correct Return-Path
|
|
header when using sendmail.
|
|
</para>
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
<para>
|
|
See also <function>mail</function>,
|
|
<function>mb_encode_mimeheader</function>, and
|
|
<function>mb_language</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-get-info">
|
|
<refnamediv>
|
|
<refname>mb_get_info</refname>
|
|
<refpurpose>Get internal settings of mbstring</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_get_info</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>type</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_get_info</function> returns internal setting
|
|
parameter of mbstring.
|
|
</simpara>
|
|
<para>
|
|
If <parameter>type</parameter> isn't specified or is specified to
|
|
"all", an array having the elements "internal_encoding",
|
|
"http_output", "http_input", "func_overload" will be returned.
|
|
</para>
|
|
<para>
|
|
If <parameter>type</parameter> is specified for "http_output",
|
|
"http_input", "internal_encoding", "func_overload",
|
|
the specified setting parameter will be returned.
|
|
</para>
|
|
<para>
|
|
See also <function>mb_internal_encoding</function>,
|
|
<function>mb_http_output</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-regex-encoding">
|
|
<refnamediv>
|
|
<refname>mb_regex_encoding</refname>
|
|
<refpurpose>
|
|
Returns current encoding for multibyte regex as string
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_regex_encoding</methodname>
|
|
<methodparam choice="opt">
|
|
<type>string</type><parameter>encoding</parameter>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_regex_encoding</function> returns the character
|
|
encoding used by multibyte regex functions.
|
|
</simpara>
|
|
<para>
|
|
If the optional parameter <parameter>encoding</parameter> is
|
|
specified, it is set to the character encoding for multibyte
|
|
regex. The default value is the internal character encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_internal_encoding</function>,
|
|
<function>mb_ereg</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-ereg">
|
|
<refnamediv>
|
|
<refname>mb_ereg</refname>
|
|
<refpurpose>Regular expression match with multibyte support</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>mb_ereg</methodname>
|
|
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam choice="opt">
|
|
<type>array</type><parameter>regs</parameter>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_ereg</function> executes the regular expression
|
|
match with multibyte support, and returns 1 if matches are found.
|
|
If the optional third parameter was specified, the function
|
|
returns the byte length of matched part, and therarray
|
|
<parameter>regs</parameter> will contain the substring of matched
|
|
string. The functions returns 1 if it matches with the empty
|
|
string. It no matche found or error happend, &false; will be
|
|
returned.
|
|
</simpara>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_eregi</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-eregi">
|
|
<refnamediv>
|
|
<refname>mb_eregi</refname>
|
|
<refpurpose>
|
|
Regular expression match ignoring case with multibyte support
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>mb_eregi</methodname>
|
|
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam choice="opt">
|
|
<type>array</type><parameter>regs</parameter>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_eregi</function> executes the regular expression
|
|
match with multibyte support, and returns 1 if matches are found.
|
|
This function ignore case.
|
|
If the optional third parameter was specified, the function
|
|
returns the byte length of matched part, and therarray
|
|
<parameter>regs</parameter> will contain the substring of matched
|
|
string. The functions returns 1 if it matches with the empty
|
|
string. It no matche found or error happend, &false; will be
|
|
returned.
|
|
</simpara>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_ereg</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-ereg-replace">
|
|
<refnamediv>
|
|
<refname>mb_ereg_replace</refname>
|
|
<refpurpose>Replace regular expression with multibyte support</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_ereg_replace</methodname>
|
|
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>replacement</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam choice="opt">
|
|
<type>array</type><parameter>option</parameter>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_ereg_replace</function> scans
|
|
<parameter>string</parameter> for matches to
|
|
<parameter>pattern</parameter>, then replaces the matched text
|
|
with <parameter>replacement</parameter> and returns the result
|
|
string or &false; on error. Multibyte character can be used in
|
|
<parameter>pattern</parameter>.
|
|
</simpara>
|
|
<simpara>
|
|
Matching condition can be set by <parameter>option</parameter>
|
|
parameter. If <literal>i</literal> is specified for this
|
|
parameter, the case will be ignored. If <literal>x</literal> is
|
|
specified, white space will be ignored. If <literal>m</literal>
|
|
is specified, match will be executed in multiline mode and line
|
|
break will be included in '.'. If <literal>p</literal> is
|
|
specified, match will be executed in POSIX mode, line break
|
|
will be considered as normal character. If <literal>e</literal>
|
|
is specified, <parameter>replacement</parameter> string will be
|
|
evaluated as PHP expression.
|
|
</simpara>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_eregi_replace</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-eregi-replace">
|
|
<refnamediv>
|
|
<refname>mb_eregi_replace</refname>
|
|
<refpurpose>
|
|
Replace regular expression with multibyte support
|
|
ignoring case
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>mb_eregi_replace</methodname>
|
|
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>replace</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_ereg_replace</function> scans
|
|
<parameter>string</parameter> for matches to
|
|
<parameter>pattern</parameter>, then replaces the matched text
|
|
with <parameter>replacement</parameter> and returns the result
|
|
string or &false; on error. Multibyte character can be used in
|
|
<parameter>pattern</parameter>. The case will be ignored.
|
|
</simpara>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_ereg_replace</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-split">
|
|
<refnamediv>
|
|
<refname>mb_split</refname>
|
|
<refpurpose>Split multibyte string using regular expression</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>mb_split</methodname>
|
|
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam choice="opt">
|
|
<type>int</type><parameter>limit</parameter>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_split</function> split multibyte
|
|
<parameter>string</parameter> using regular expression
|
|
<parameter>pattern</parameter> and returns the result as an
|
|
array.
|
|
</simpara>
|
|
<simpara>
|
|
If optional parameter <parameter>limit</parameter> is specified,
|
|
it will be split in <parameter>limit</parameter> elements as
|
|
maximum.
|
|
</simpara>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_ereg</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-ereg-match">
|
|
<refnamediv>
|
|
<refname>mb_ereg_match</refname>
|
|
<refpurpose>
|
|
Regular expression match for multibyte string
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>mb_ereg_match</methodname>
|
|
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam choice="opt">
|
|
<type>string</type><parameter>option</parameter>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_ereg_match</function> returns &true; if
|
|
<parameter>string</parameter> matches regular expression
|
|
<parameter>pattern</parameter>, &false; if not.
|
|
</simpara>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_ereg</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-ereg-search">
|
|
<refnamediv>
|
|
<refname>mb_ereg_search</refname>
|
|
<refpurpose>
|
|
Multibyte regular expression match for predefined multibyte string
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>mb_ereg_search</methodname>
|
|
<methodparam choice="opt">
|
|
<type>string</type><parameter>pattern</parameter>
|
|
</methodparam>
|
|
<methodparam choice="opt">
|
|
<type>string</type><parameter>option</parameter>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_ereg_search</function> returns &true; if the
|
|
multibyte string matches with the regular expression, &false; for
|
|
otherwise. The string for matching is set by
|
|
<function>mb_ereg_search_init</function>. If
|
|
<parameter>pattern</parameter> is not specified, the previous one
|
|
is used.
|
|
</simpara>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_ereg_search_init</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-ereg-search-pos">
|
|
<refnamediv>
|
|
<refname>mb_ereg_search_pos</refname>
|
|
<refpurpose>
|
|
Return position and length of matched part of multibyte regular
|
|
expression for predefined multibyte string
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>mb_ereg_search_pos</methodname>
|
|
<methodparam choice="opt">
|
|
<type>string</type><parameter>pattern</parameter>
|
|
</methodparam>
|
|
<methodparam choice="opt">
|
|
<type>string</type><parameter>option</parameter>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_ereg_search_pos</function> returns an array including
|
|
position of matched part for multibyte regular expression.
|
|
The first element of the array will be the beggining of matched
|
|
part, the second element will be length (bytes) of matched part.
|
|
It returns &false; on error.
|
|
</simpara>
|
|
<para>
|
|
The string for match is specified by
|
|
<function>mb_ereg_search_init</function>. It it is not specified,
|
|
the previous one will be used.
|
|
</para>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_ereg_search_init</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-ereg-search-regs">
|
|
<refnamediv>
|
|
<refname>mb_ereg_search_regs</refname>
|
|
<refpurpose>
|
|
Returns the matched part of multibyte regular expression
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>mb_ereg_search_regs</methodname>
|
|
<methodparam choice="opt">
|
|
<type>string</type><parameter>pattern</parameter>
|
|
</methodparam>
|
|
<methodparam choice="opt">
|
|
<type>string</type><parameter>option</parameter>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_ereg_search_regs</function> executes the multibyte
|
|
regular expression match, and if there are some matched part, it
|
|
returns an array including substring of matched part as first
|
|
element, the first grouped part with brackets as second element,
|
|
the second grouped part as third element, and so on. It returns
|
|
&false; on error.
|
|
</simpara>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_ereg_search_init</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-ereg-search-init">
|
|
<refnamediv>
|
|
<refname>mb_ereg_search_init</refname>
|
|
<refpurpose>
|
|
Setup string and regular expression for multibyte regular
|
|
expression match
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>mb_ereg_search_init</methodname>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
<methodparam choice="opt">
|
|
<type>string</type><parameter>pattern</parameter>
|
|
</methodparam>
|
|
<methodparam choice="opt">
|
|
<type>string</type><parameter>option</parameter>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_ereg_search_init</function> sets
|
|
<parameter>string</parameter> and <parameter>pattern</parameter>
|
|
for multibyte regular expression. These values are used for
|
|
<function>mb_ereg_search</function>,
|
|
<function>mb_ereg_search_pos</function>,
|
|
<function>mb_ereg_search_regs</function>. It returns &true; for
|
|
success, &false; for error.
|
|
</simpara>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_ereg_search_regs</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-ereg-search-getregs">
|
|
<refnamediv>
|
|
<refname>mb_ereg_search_getregs</refname>
|
|
<refpurpose>
|
|
Retrive the result from the last multibyte regular expression
|
|
match
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>mb_ereg_search_getregs</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_ereg_search_getregs</function> returns an array
|
|
including the sub-string of matched part by last
|
|
<function>mb_ereg_search</function>,
|
|
<function>mb_ereg_search_pos</function>,
|
|
<function>mb_ereg_search_regs</function>. If there are some
|
|
maches, the first element will have the matched sub-string, the
|
|
second element will have the first part grouped with brackets,
|
|
the third element will have the second part grouped with
|
|
brackets, and so on. It returns &false; on error;
|
|
</simpara>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_ereg_search_init</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-ereg-search-getpos">
|
|
<refnamediv>
|
|
<refname>mb_ereg_search_getpos</refname>
|
|
<refpurpose>
|
|
Returns start point for next regular expression match
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>mb_ereg_search_getpos</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_ereg_search_getpos</function> returns
|
|
the point to start regular expression match for
|
|
<function>mb_ereg_search</function>,
|
|
<function>mb_ereg_search_pos</function>,
|
|
<function>mb_ereg_search_regs</function>. The position is
|
|
represented by bytes from the head of string.
|
|
</simpara>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_ereg_search_setpos</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.mb-ereg-search-setpos">
|
|
<refnamediv>
|
|
<refname>mb_ereg_search_setpos</refname>
|
|
<refpurpose>
|
|
Set start point of next regular expression match
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>mb_ereg_search_setpos</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
&warn.experimental.func;
|
|
<simpara>
|
|
<function>mb_ereg_search_setpos</function> sets the starting
|
|
point of match for <function>mb_ereg_search</function>.
|
|
</simpara>
|
|
<para>
|
|
The internal encoding or the character encoding specified in
|
|
<function>mb_regex_encoding</function> will be used as character
|
|
encoding.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This function is supported in PHP 4.2.0 or higher.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also: <function>mb_regex_encoding</function>,
|
|
<function>mb_ereg_search_init</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
</reference>
|
|
|
|
<!-- 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
|
|
-->
|
|
|