What if PHP operates on XML? Solution Solutions

Source: Internet
Author: User
Tags xml parser
What if PHP operates on XML?
Does PHP have an XML operation?
such as can search, paging, etc.

------Solution--------------------
SimpleXML
------Solution--------------------
SimpleXML functions
Brief introduction
The SimpleXML extension provides a very simple and easily usable toolset to convert XML to an object so can be processed With the normal property selectors and array iterators.

Demand
The SimpleXML extension requires PHP 5.

Installation
The SimpleXML extension is enabled by default. To disable it, use the--disable-simplexml configure option.

Or

PHP XML Syntax parsing function
Brief introduction
XML (extensible Markup Language, Extensible Markup Language) is a data format for document exchange on the Web. The language is a standard defined by the World Wide Web Concortium, www organization. You can access http://www.w3.org/XML/to get more information about XML and its related technologies.

This extension provides support for James Clark's expat. The toolkit helps to parse the XML document (not the XML document's validity). It supports the encoding of three source codes, which are supported by PHP itself: Us-ascii, iso-8859-1, and UTF-8. The system does not yet support UTF-16.

This extension enables the user to create an XML parser and define the corresponding processor for different XML events. Each XML parser has several parameters that can be adjusted as needed.

Demand
This extension uses the Expat Compat layer by default. It can also use expat, which can be accessed by http://www.jclark.com/xml/expat.html. The expat Makefile file does not generate a default extension library and can be implemented using the following build rules: Libexpat.a: $ (OBJS)
AR-RC $@ $ (OBJS)
Ranlib $@



Please visit http://sourceforge.net/projects/expat/to get the RPM package for expat source files.

Installation
These functions are valid by default, and they use the bundled expat library. You can block XML support by using the parameter--disable-xml. If you compile PHP as a module of Apache 1.3.9 or later, PHP will automatically use the Apache bundled expat library. If you do not want to use the bundle's expat library, use the parameter--with-expat-dir=dir when you run PHP's configure configuration script, where dir should point to the root of the expat installation.

PHP's version of Windows has built-in support for this extension. You can use these functions without loading any additional extension libraries.


------Solution--------------------
1 Manual.
2 input XML
3 Example production.
4.
------Solution--------------------
$xml = Xml_parser_create ();
Xml_parse_into_struct ($xml, $post _raw, $xvals, $xindexs);
  • Related Article

    Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.