update page now
PHP 8.1.34 Released!

The Dom\TokenList class

(PHP 8 >= 8.4.0)

Introduzione

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

Sommario della classe

final class Dom\TokenList implements IteratorAggregate, Countable {
/* Proprietà */
public readonly int $length;
public string $value;
/* Metodi */
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
}

Proprietà

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

Note

Nota: 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.

Nota: Tokens in the list can be accessed by array syntax.

Indice dei contenuti

add a note

User Contributed Notes

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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant