码迷,mamicode.com
首页 > Web开发 > 详细

php提取xml配置参数

时间:2015-05-05 10:18:34      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:

demo1.php

<?php

class AddressManager{

    private $addresses = array("ip地址1","ip地址2");

 

    function outputAddress( $resolve ){

        foreach($this->addresses as $address){

             print $address;

             if( $resolve ){

                 print "(".gethostbyaddr( $address ).")";

             }

             print "\n";

        }

    }

}

 

demo1.xml

$settings = simplexml_load_file("demo1.xml");

$manager = new AddressManager();

$manager->outputAddress( (string) $settings->resolvedomains );

?>

php提取xml配置参数

标签:

原文地址:http://www.cnblogs.com/dymg/p/4478263.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!