PHP 8.3.4 Released!

xml_get_current_byte_index

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

xml_get_current_byte_indexXML パーサのカレントのバイトインデックスを得る

説明

xml_get_current_byte_index(XMLParser $parser): int

指定した XML パーサのカレントのバイトインデックスを取得します。

パラメータ

parser

バイトインデックスを得る XML パーサへのリファレンス。

戻り値

データバッファにおいて、パーサが現在処理中のバイトインデックス (先頭が 0) を返します。

変更履歴

バージョン 説明
8.0.0 引数 parser は、 XMLParser インスタンスを期待するようになりました。 これより前のバージョンでは、有効な xml resource が期待されていました。

注意

警告

この関数は、UTF-8 エンコードされたテキストに基づいたバイトインデックスを返します。 入力が他のエンコーディングであっても無視します。

参考

add a note

User Contributed Notes 1 note

up
1
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