| 代码如下 | 复制代码 |
| class dom { protected $_dom = null; public function __construct($xmlfile = '',$ver = '',$encoding = '') { $this -> _dom = ($ver && $encoding)? new domdocument($ver,$encoding):new domdocument(); $xml = !$xmlfile?file_get_contents('php://input'):file_get_contents($xmlfile); $this -> _dom -> loadxml($xml); } public function getvalue($nodename) { $nodes = $this -> _dom -> getelementsbytagname($nodename); return null !== $nodes -> item(0)?$nodes -> item(0) -> nodevalue:false; } } |
|
//本xml类代码是利用了php domdocument来解析xml文档 ?>
Wreckreation兑换码分享 Wreckreation最新2025兑换码大全
魔法师西蒙之起源兑换码是什么 Simon the Sorcerer Origins最新兑换码
Master of Command兑换码分享 Master of Command最新2025兑换码大全
Nerd Simulator兑换码是什么 Nerd Simulator最新2025兑换码一览
逃离鸭科夫零号区基础建设任务怎么攻略 基础建设任务流程攻略
刷屏至死兑换码分享 刷屏至死最新2025兑换码大全