Menu

## DOMNode
in package

DOMNode.php : 18

Class representing a DOM Node.

##### Tags

see
  https://www.kotchasan.com/

### Table of Contents

$attributes : array<string|int, mixed>
  List of node attributes.
$childNodes : array<string|int, mixed>
  List of child nodes.
$level : int
  Node level. The outermost level is 0.
$nextSibling : DOMNode
  Next sibling node. If it's the last node, it will be null.
$nodeName : mixed
  Node name.
$nodeValue : string|null
  Node value. It will be null if the node is a tag.
$parentNode : DOMNode
  Parent node.
$previousSibling : DOMNode
  Previous sibling node. If it's the first node, it will be null.
__construct() : mixed
  Class constructor.
hasChildNodes() : bool
  Check if the node has child nodes.
hasClass() : bool
  Check if the node has a specific class.
isInlineElement() : bool
  Check if the element is an inline element.
nodeText() : string
  Get the concatenated text content of the node and its descendants.
unentities() : string
  Convert HTML entities to their corresponding characters.

### Properties

#### $attributes

DOMNode.php : 25

List of node attributes.

`public array<string|int, mixed> $attributes = []`

#### $childNodes

DOMNode.php : 33

List of child nodes.

`public array<string|int, mixed> $childNodes`

#### $level

DOMNode.php : 40

Node level. The outermost level is 0.

`public int $level`

#### $nextSibling

DOMNode.php : 48

Next sibling node. If it's the last node, it will be null.

`public DOMNode $nextSibling`

#### $nodeName

DOMNode.php : 55

Node name.

`public mixed $nodeName`

#### $nodeValue

DOMNode.php : 63

Node value. It will be null if the node is a tag.

`public string|null $nodeValue`

nodeValue

#### $parentNode

DOMNode.php : 71

Parent node.

`public DOMNode $parentNode`

#### $previousSibling

DOMNode.php : 79

Previous sibling node. If it's the first node, it will be null.

`public DOMNode $previousSibling`

### Methods

#### __construct()

DOMNode.php : 89

Class constructor.

`public __construct(string $nodeName, DOMNode|null $parentNode, array<string|int, mixed> $attributes[, string|null $nodeValue = null ]) : mixed`

##### Parameters

$nodeName : string

  The tag name. If there is no tag name, it represents empty text.

$parentNode : DOMNode|null

  The parent node. If it's the first node, it will be null.

$attributes : array<string|int, mixed>

  The node attributes (properties).

$nodeValue : string|null = null

  The text content of the node. It will be null if the node is a tag.

##### Return values

mixed —

#### hasChildNodes()

DOMNode.php : 108

Check if the node has child nodes.

`public hasChildNodes() : bool`

##### Return values

bool —

True if it has child nodes, false otherwise.

#### hasClass()

DOMNode.php : 120

Check if the node has a specific class.

`public hasClass(string $className) : bool`

##### Parameters

$className : string

  The class name to check.

##### Return values

bool —

True if it has the class, false otherwise.

#### isInlineElement()

DOMNode.php : 138

Check if the element is an inline element.

`public isInlineElement() : bool`

##### Return values

bool —

True if it's an inline element, false if it's a block-level element.

#### nodeText()

DOMNode.php : 156

Get the concatenated text content of the node and its descendants.

`public nodeText() : string`

##### Return values

string —

The concatenated text content.

#### unentities()

DOMNode.php : 184

Convert HTML entities to their corresponding characters.

`public unentities(string $html) : string`

##### Parameters

$html : string

  The HTML string to convert.

##### Return values

string —

The converted string.

## Search results