SimpleXML: Creating a SimpleXMLElementTag: SimpleXML, SimpleXMLElement, XML Category: PHP Basicpost: 17 Apr 2008 read: 993 PHP SimpleXML Step By Step Tutorial - Part 1: The SimpleXML extension is another xml parser available in PHP5. We ever talk about xml parser tips at here. SimpleXML make our job more easy. I takes a different approach to handling the tree. This extension has a single class type, three functions, and six class methods. Ok, first part of this tutorial series about SimpleXML, we create a XML document use SimpleXMLElement. We use new keyword to be directly instantiated using an XML document within a string as its data source. See like this:
SimpleXML have asXML() method. With this method, we can output a document or substree to a string or a file. If you want to print to browser, you can use like this:
You can see above. When no parameter is passed to this method, the results are returned as a string. If we want to save to a file, we can use like this:
|
| | Give Your Opinion | Recommend |
|


