PHP 8.3.4 Released!

xml_get_current_byte_index

(PHP 4, PHP 5, PHP 7, PHP 8)

xml_get_current_byte_index获取 XML 解析器的当前字节索引

说明

xml_get_current_byte_index(XMLParser $parser): int

获取指定 XML 解析器的当前字节索引(current byte index)。

参数

parser

指向要取得字节索引的 XML 解析器的引用。

返回值

返回解析器当前在其数据缓冲区中的字节索引(起始值为 0)。

更新日志

版本 说明
8.0.0 parser 现在接受 XMLParser 实例;之前接受有效的 xml resource

注释

警告

该函数将返回根据 UTF-8 编码的文本的字节索引,而不论输入是否是其他的编码。

参见

add a note

User Contributed Notes 1 note

up
0
turan dot yuksel at tcmb dot gov dot tr
18 years ago
The outcome of this function is heavily dependent on the parser implementation used. For example, at the point where the start_element_ callback is called, libxml2 parser consumes the entire element name and attributes, however expat does not.
To Top