1, preface XML tree hierarchy is clear, very suitable as a configuration file. You can use DOM XML to manipulate XML in PHP. This article summarizes PHP using DOM XML to create, add nodes, and query XML files. 2, using DOM XML XML to divide
PHPl uses DOMXML to operate XML [summary]. 1. preface the XML tree structure is clear and suitable for configuration files. In PHP, DOMXML can be used to operate XML. This article summarizes how PHP uses DOMXML to create, add nodes, and query XML
1. DOM functionsA, Domdocument-Role: Loading an XML fileUsage: domdocument-Parameters: Filename,xml file;Returns: TRUE if successful, or FALSE if unsuccessful.B, Domdocument-Role: Loading XML codeUsage: Domdocument-Parameters: source XML
1. DOM functions
A, Domdocument->load ()
Role: Loading an XML file
Usage: domdocument->load (string filename)
Parameters: Filename,xml file;
Returns: TRUE if successful, or FALSE if unsuccessful.
B, Domdocument->loadxml ()
Role: Loading XML
1. DOM function
A, Domdocument->load ()Function: Load XML fileUsage: domdocument->load (string filename)Parameters: Filename,xml file;Return: Returns TRUE if successful and FALSE if failed.
B, Domdocument->loadxml ()function: Load XML codeUsage:
Set of common phpxml functions (more detailed ). 1. Functions of DOM a and DOMDocument-load (): loads xml files. usage: DOMDocument-load (stringfilename) parameter: filename, xml file; return: TRUE if successful, error
1. DOM functions
A.
1. DOM Functions
A. DOMDocument-> load ()Purpose: load xml files.Usage: DOMDocument-> load (string filename)Parameter: filename, xml file;Return: if the operation succeeds, TRUE is returned. If the operation fails, FALSE is returned.
B. DOMDocument->
1. DOM Functions
A. DOMDocument-> load ()Purpose: load xml files.Usage: DOMDocument-> load (string filename)Parameter: filename, xml file;Return: if the operation succeeds, TRUE is returned. If the operation fails, FALSE is returned.
B. DOMDocument->
7. Create a Node
In DOM operations, adding and deleting operations must find the parent node
1, DomElement domdocument::createelement (String $name [, String $value])
Creates a node and returns a Node object
String $name: Name of the node (element
: This article mainly introduces XMLDOM (11) in php. if you are interested in the PHP Tutorial, refer to it. 7. create a node
In dom operations, you must find the parent node for addition, deletion, and modification operations.
1. DOMElement
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.