xml_error_string()

xml_error_string() — Get XML parser error string.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

What it does

Gets the XML parser error string associated with the given error_code.

Signature

xml_error_string(int $error_code): ?string

Parameters

ParameterTypeWhat it takes
$error_codeintAn error code from xml_get_error_code().

Return value

Returns a string with a textual description of the error error_code, or null or "Unknown" if no description was found.

Example

The PHP manual ships no example for xml_error_string(); the signature and the parameter table above are the contract.

See also

xml_get_error_code()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page xml_error_string() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.