Definition and usage
The _ construct () function creates a new SimpleXMLElement object.
If yes, the function returns an object. If it fails, false is returned.
Syntax
__construct(data,options,is_url,ns,is_prefix)
Parameters |
Description |
Data |
Required. The path or URL of an XML string or XML document. |
Options |
Optional. Specifies the additional Libxml parameter. |
Is_url |
Optional. Specifies whether the data parameter is a URL. The default value is false. |
Ns |
Optional. |
Is_prefix |
Optional. |
Return Value
Returns a SimpleXMLElement object that represents data.
Example
<?php$xmlstring = <<<XML<?xml version="1.0" encoding="ISO-8859-1"?><note><to>George</to><from>John</from>SimpleXMLElement($xmlstring);echo $xml->body[0];?>
The output is similar:
Don't forget the meeting!
Later, we can see that the front _ of construct is one. I rely on it. This is also the last error. I forgot, but now I remember it.
Function _ construct ()
{}
No
Function _ construct ()
{}