Heim  >  Artikel  >  Backend-Entwicklung  >  Codeigniter通过SimpleXML将xml转换成对象的方法_PHP教程

Codeigniter通过SimpleXML将xml转换成对象的方法_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:02:23732Durchsuche

Codeigniter通过SimpleXML将xml转换成对象的方法

 这篇文章主要介绍了Codeigniter通过SimpleXML将xml转换成对象的方法,涉及Codeigniter操作XML文件的技巧,非常具有实用价值,需要的朋友可以参考下

 

 

本文实例讲述了Codeigniter通过SimpleXML将xml转换成对象的方法。分享给大家供大家参考。具体分析如下:

SimpleXML是一个php扩展,有了它可以非常容易的操作xml文件

?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

class CI_ManipulateXML

{

var $xml='';

function CI_ManipulateXML($xmlcontent)

{

$this->xml=$xmlcontent;

}

function ConvertXML() {

try {

$xmlobject = new SimpleXMLElement($this->xml);

if ($xmlobject == false) {

return false;

}

}

catch (Exception $e) {

return false;

}

return $xmlobject;

}

}

希望本文所述对大家的基于Codeigniter框架的php程序设计有所帮助。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/970751.htmlTechArticleCodeigniter通过SimpleXML将xml转换成对象的方法 这篇文章主要介绍了Codeigniter通过SimpleXML将xml转换成对象的方法,涉及Codeigniter操作XML文件的技巧...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn