Difference between simplexml_load_file and simplexml_load_string

回眸只為那壹抹淺笑 提交于 2019-12-01 13:18:56

Each of the two functions returns SimpleXMLElement object, so you only need one of them depending on what you have to begin with, whether you have path to an XML file or content of the XML it self in a string variable, etc.

Notice in the documentation page, that simplexml_load_string() expects the string parameter to contain the actual XML content, while simplexml_load_file() expects the string parameter to contain path to the XML file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!