Definition and usage
The __construct () function creates a new SimpleXMLElement object.
If successful, the function returns an object. If it fails, it returns false.
Grammar
__construct (Data,options,is_url,ns,is_prefix)
Parameters |
Description |
Data |
Necessary. The path or URL of a well-formed XML string or XML document. |
Options |
Optional. Specifies the additional Libxml parameters. |
Is_url |
Optional. Specifies whether the data parameter is a URL. The default is False. |
Ns |
Optional. |
Is_prefix |
Optional. |
return value
Returns a SimpleXMLElement object that represents the data.
Example
George
John
Reminder
Don ' t Forget the meeting!
SimpleXMLElement($xmlstring)
; echo $xml->body[0];? >
The output is similar to:
Don ' t forget the meeting!
The above describes the constructor php constructor construct the previous underscore is a double _, including the constructor aspect of the content, I hope that the PHP tutorial interested in a friend helpful.