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!
http://www.bkjia.com/PHPjc/320957.html www.bkjia.com true http://www.bkjia.com/PHPjc/320957.html techarticle define and use the __construct () function to create a new SimpleXMLElement object. If successful, the function returns an object. If it fails, it returns false. Grammar __constru ...