PHP xml_parser_create() 函数

PHP 教程 · 2019-01-30 18:59:36

定义和用法

xml_parser_create() 函数创建 XML 解析器。

如果成功,该函数则返回可被其它 XML 函数使用的资源句柄。如果失败,则返回 FALSE。

语法


xml_parser_create(encoding)


参数 描述
encoding 可选。规定输出编码。在 PHP 5.0.2 及以上的版本中,默认是 UTF-8。

可能的值:

  • ISO-8859-1
  • UTF-8
  • US-ASCII.

注释:在 PHP 5 中,输入编码会被自动侦测。在 PHP 4 及之前的版本中,该参数规定输入和输出的字符编码。

注释: 在 PHP 5.0.0 和 5.0.1 中,默认的输出字符集是 ISO-8859-1。


提示和注释

提示:要释放 XML 解析器,请使用 xml_parser_free() 函数。

提示:要创建带有命名空间支持的 XML 解析器,请使用 xml_parser_create_ns() 函数。

实例


<?php
$xmlparser = xml_parser_create();
xml_parser_free($xmlparser);
?>


点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Transcending CSS

Transcending CSS

Andy Clarke、Molly E. Holzschlag / New Riders / November 15, 2006 / $49.99

As the Web evolves to incorporate new standards and the latest browsers offer new possibilities for creative design, the art of creating Web sites is also changing. Few Web designers are experienced p......一起来看看 《Transcending CSS》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

MD5 加密
MD5 加密

MD5 加密工具