xml提取

$url = 'http://221.232.141.108/hsdcw/news.xml';
$opts = array(
'http'=>array(
'method'=>"GET",
'timeout'=>,
)
); $context = stream_context_create($opts);
$str = file_get_contents($url, false, $context);
$str = trim($str);
$xml = simplexml_load_string($str,'SimpleXMLElement', LIBXML_NOCDATA);
$j = json_encode($xml);
file_put_contents('/news.log',$j);
上一篇:CSS3 概览 更新时间 2014-0412-1317


下一篇:【C#学习笔记】读文件