Function __global->xhtmlise_html

Definitions

sources/xhtml.php

  • Function that 'fixes' HTML (or bad XHTML) enough for it to pass most basic structural webstandards checking.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$html string No No required parameter N/A N/A The XHTML string to convert to XHTML
$definitely_want boolean No No False N/A N/A Whether to force a repair even if we aren't enforcing XHTML strictness
$snippet boolean No No False N/A N/A Whether this is a partial snippet of HTML, embeddable in some unknown context

Returns

  • The converted string
  • Type: string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Function that 'fixes' HTML (or bad XHTML) enough for it to pass most basic structural webstandards checking.
 *
 * @param  string $html The XHTML string to convert to XHTML
 * @param  boolean $definitely_want Whether to force a repair even if we aren't enforcing XHTML strictness
 * @param  boolean $snippet Whether this is a partial snippet of HTML, embeddable in some unknown context
 * @return string The converted string
 */

function xhtmlise_html(string $html, bool $definitely_want = false, bool $snippet = false) : string