Skip to content

Kirby 5.0.4

Xml::encode()

Converts a string to an XML-safe string

Xml::encode(string|null $string, bool $html = true): string

Parameters

Name Type Default Description
$string stringornull no default value
$html bool true True = Convert to HTML-safe first

Return type

string

Parent class

Kirby\Toolkit\Xml

Examples

echo Xml::encode('some über crazy stuff');
// output: some über crazy stuff