mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-17 09:28:56 +00:00
114 lines
3 KiB
XML
114 lines
3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="function.imap-mime-header-decode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>imap_mime_header_decode</refname>
|
|
<refpurpose>Decode MIME header elements</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>array</type><type>false</type></type><methodname>imap_mime_header_decode</methodname>
|
|
<methodparam><type>string</type><parameter>string</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Decodes MIME message header extensions that are non ASCII text (see <link
|
|
xlink:href="&url.rfc;2047">RFC2047</link>).
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>string</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The MIME text
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
The decoded elements are returned in an array of objects, where each
|
|
object has two properties, <literal>charset</literal> and
|
|
<literal>text</literal>.
|
|
</para>
|
|
<para>
|
|
If the element hasn't been encoded, and in other words is in
|
|
plain US-ASCII, the <literal>charset</literal> property of that element is
|
|
set to <literal>default</literal>.
|
|
</para>
|
|
<para>
|
|
The function returns &false; on failure.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>imap_mime_header_decode</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$text = "=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@example.com>";
|
|
|
|
$elements = imap_mime_header_decode($text);
|
|
for ($i=0; $i<count($elements); $i++) {
|
|
echo "Charset: {$elements[$i]->charset}\n";
|
|
echo "Text: {$elements[$i]->text}\n\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Charset: ISO-8859-1
|
|
Text: Keld Jørn Simonsen
|
|
|
|
Charset: default
|
|
Text: <keld@example.com>
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
In the above example we would have two elements, whereas the first
|
|
element had previously been encoded with ISO-8859-1, and the second
|
|
element would be plain US-ASCII.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>imap_utf8</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/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
|
|
-->
|