PHP: Whats's the difference between the SimpleXMLElement() class and SimpleXML_load_string()?

前端 未结 3 1789
伪装坚强ぢ
伪装坚强ぢ 2021-02-02 11:34

I\'ve seen alot of coders implement SimpleXML_load_string() instead of the SimpleXMLElement() class. Are there any benefits to using the former over th

3条回答
  •  离开以前
    2021-02-02 11:54

    simplexml_load_string can return a different object:

    class_name

    You may use this optional parameter so that simplexml_load_string() will return an object of the specified class. That class should extend the SimpleXMLElement class.

提交回复
热议问题