Do you want to add new lines to the instantiation of a knot image?

Source: Internet
Author: User
See someone write $_sxe=simplexml_load_file (' Text.xml ') like this;
Is this a function or an object?


Reply to discussion (solution)

Simplexml_load_file is a function
He returns a SimpleXMLElement object

You bought a car in a 4S store, and you don't need to build it.

Simplexml_load_file is a function
He returns a SimpleXMLElement object

You bought a car in a 4S store, and you don't need to build it.



As you say, any PHP built-in object can not be declared, directly using the function in the object as a method of instantiation?

How can you be so understanding? You should take a look at the handbook.

You are sick, do not want to answer, go away, your mother B do not read the handbook still use you to mention it, I can not understand how you disagree Ah! Exercise!

How can you be so understanding? You should take a look at the handbook.

Your mother B You have no problem with PHP now, is not a problem you read the manual ah, lack of heart or stupid you?

$_sxe=simplexml_load_file (' Text.xml ');

Assigns the SimpleXMLElement object returned by the Simplexml_load_file function to the $_SXE variable.

Look at the manual is necessary, a lot of questions online does not necessarily have, you can do is to read manuals, manuals, or even to see the source

In this case, the return value of this function is an instantiated object, just like the singleton pattern, you don't need new, but you're manipulating the object.

Simplexml_load_file is a function
And the data returned by Simplexml_load_file is an object
There is no conflict between the two.

For example: Foo is a method and returns an object.

function foo () {    $ret = array (        ' name ' = ' Fdipzone '    );    Return (object) $ret;} $obj = foo (); Echo $obj->name; Fdipzone

Simplexml_load_file is a function
And the data returned by Simplexml_load_file is an object
There is no conflict between the two.

For example: Foo is a method and returns an object.

function foo () {    $ret = array (        ' name ' = ' Fdipzone '    );    Return (object) $ret;} $obj = foo (); Echo $obj->name; Fdipzone


I think you are right, remember that JavaScript is used in this principle, in order to have ligatures function.

I just wonder why there are always some silly busy playing here, here is fun? Your mother B You do not like to answer other people's questions, or you are very disgusted with other people ask questions, your mother B you can leave here ah, here is not your mother's forced the brothel, is not a movie theater, really your mother B do not understand, why you here by this sin, there is only one explanation, lack of mind!

  • 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.