Using the PHP Function XML_Set_Default_Handler()
A function is a block of statements that can be called from within the PHP script, to perform a specific task. PHP has more than 1000 built-in functions, that can be used for various purposes. A function can take arguments and return a value, or a string.
Functions are created using the function statement, starting with a keyword and followed by a curly (
The xml_set_default_handler() function is an inbuilt function for PHP to set default handlers for XML documents. This enables PHP to parse XML document without the need for an external XML parser.
XML is a text-based markup language for describing structured data on the web. PHP has an inbuilt XML parser that is known as Expat. The XML parser does not validate, but it is suitable for web applications, because it is fast.
This php function has five parameters, parser, name, base, system_id and public_id. The 'handler' specifies the function to be called when the XML parser finds a notation declaration.
This function allows you to set which source encoding is used when creating an XML parser. You can use ISO-8859-1, US-ASCII or UTF-8. If you do not specify a source encoding, the XML parser will default to ISO-8859-1.