PHP constructor construct the front underscore is a double __php technique

Source: Internet
Author: User
The
definition and Usage

__construct () function creates a new SimpleXMLElement object. If the

succeeds, the function returns an object. If it fails, it returns false.

Syntax
 __construct (data,options,is_url,ns,is_prefix) 
parameter description
Data is required. A well-formed XML string or path or URL to an XML document.
options is optional. Specify the additional Libxml parameters.
is_url is optional. Specify whether the data parameter is a URL. The default is False.
NS is optional.
is_prefix is optional. The
return value

Returns a SimpleXMLElement object that represents the data.

Example
 <?php $xmlstring = <<<xml <?xml version= "1.0" encoding= "iso-8859-1"?> <note > <to>George</to> <from>John</from>  simplexmlelement ($xmlstring) ; echo $xml->body[0]; 

Output is similar:

 Don ' t forget the meeting! 
Then look at the construct before _ is a, I, I was this mistake last time, forget, now remember the
function __construct ()
{}

is not a
function _construct ()
{}

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.