HTML::__toString()

Converts the HTML object to string.

Table of Contents
  1. Description
  2. Example

Description

HTML::__toString(): string;

This method will be called when you cast a HTML instance as a string. This method converts the object into its string representation.

Example

$node = new HTML(['div', 'bar', ['id' => 'foo']]);

echo $node; // Returns `'<div id="foo">bar</div>'`

HTML::__toString()

Converts the HTML object to string.