PHP 8.5.0 Beta 3 available for testing

Dom\TokenList クラス

(PHP 8 >= 8.4.0)

はじめに

属性 (例: クラス名) 中のトークンの集合の表します。

クラス概要

final class Dom\TokenList implements IteratorAggregate, Countable {
/* プロパティ */
public readonly int $length;
public string $value;
/* メソッド */
public add(string ...$tokens): void
public contains(string $token): bool
public count(): int
public item(int $index): ?string
public remove(string ...$tokens): void
public replace(string $token, string $newToken): bool
public supports(string $token): bool
public toggle(string $token, ?bool $force = null): bool
}

プロパティ

length
トークンの数
value
このオブジェクトにリンクされた属性の値

注意

注意: DOM拡張モジュールは、メソッドやプロパティで UTF-8 エンコーディングを使います。 パースをおこなうメソッドは、エンコーディングを自動的に判別し、呼び出し側でエンコーディングを指定することもできます。

注意: リスト中のトークンは、配列の記法でアクセスできます

目次

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top