class HtmlDiff (View source)

Class representing a 'diff' between two sequences of HTML strings.

Constants

private OLD_VAL

private NEW_VAL

Properties

public static string|null $html_cleaner_class

Methods

public static 
string
compareHtml(string|array $from, string|array $to, bool $escape = false)

Get a diff between two sets of HTML content. The result is an HTML fragment which can be added directly into the DOM. elements are used to indicate new content, and elements are used to indicate removed content.

Details

static string compareHtml(string|array $from, string|array $to, bool $escape = false)

Get a diff between two sets of HTML content. The result is an HTML fragment which can be added directly into the DOM. elements are used to indicate new content, and elements are used to indicate removed content.

Parameters

string|array $from
string|array $to
bool $escape

If true, the HTML in $from and $to will be escaped after the diff operation is performed.

Return Value

string