PHP 8.4.24 Released!

The Dom\TokenList class

(PHP 8 >= 8.4.0)

Вступ

Represents a set of tokens in an attribute (e.g. class names).

Короткий огляд класу

final class Dom\TokenList implements IteratorAggregate, Countable {
/* Властивості */
public readonly int $length;
public string $value;
/* Методи */
public function add(string ...$tokens): void
public function contains(string $token): bool
public function count(): int
public function getIterator(): Iterator
public function item(int $index): ?string
public function remove(string ...$tokens): void
public function replace(string $token, string $newToken): bool
public function supports(string $token): bool
public function toggle(string $token, ?bool $force = null): bool
}

Властивості

length
The number of tokens.
value
The value of the attribute linked to this object.

Примітки

Зауваження: The DOM extension uses UTF-8 encoding when working with methods or properties. The parser methods auto-detect the encoding or allow the caller to specify an encoding.

Зауваження: Tokens in the list can be accessed by array syntax.

Зміст

add a note

User Contributed Notes

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