<?php
header("content-type:text/html; charset=utf-8"); //设置编码
$lists = simplexml_load_file('auction_end_tomorrow.xml');
$channel = $lists->channel;
$titles = array();
$str='';
foreach($channel->item as $items){ //有多个user,取得的是数组,循环输出
$str .=$items->title."\r\n";;
}
$k=fopen("d:\\auction_end_tomorrow.txt","a+");//此处用a+,读写方式打开,将文件指针指向文件末尾。如果文件不存在则尝试创建之
fwrite($k,$str);
fclose($k);
?>
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦