1
0
mirror of https://github.com/php/doc-zh.git synced 2026-03-24 15:12:20 +01:00
Files
archived-doc-zh/reference/xml/functions/xml-parser-create.xml
2025-10-26 21:40:32 +08:00

104 lines
2.9 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: b47e4bea197126359815c5e43403c4b77a0aaaa7 Maintainer: class007 Status: ready -->
<!-- CREDITS: mowangjuanzi, Luffy -->
<refentry xml:id="function.xml-parser-create" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>xml_parser_create</refname>
<refpurpose>创建 XML 解析器</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>XMLParser</type><methodname>xml_parser_create</methodname>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>encoding</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
<function>xml_parser_create</function> 新建 XML 解析器并返回可被其它 XML 函数使用的 <classname>XMLParser</classname> 实例。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>encoding</parameter></term>
<listitem>
<para>
自动检测输入编码,因此 <parameter>encoding</parameter> 参数仅指定输出编码。默认输出字符集是 UTF-8。如果传递的是空字符串解析器会尝试通过查看头的的
3 或 4 个字节来识别文档的编码方式。支持的编码有 <literal>ISO-8859-1</literal><literal>UTF-8</literal><literal>US-ASCII</literal>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
返回新 <classname>XMLParser</classname> 实例。
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
此函数现在返回 <classname>XMLParser</classname> 实例;之前返回 <type>resource</type>&return.falseforfailure;
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
<parameter>encoding</parameter> 现在可以为 null。
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>xml_parser_create_ns</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
-->