php生成XML
//根据图片生成XML
$xml_path = ROOT_DIR.DIRECTORY_SEPARATOR.'/hrcms/Tpl/default/Community/xml';
if(!is_dir($xml_path)){
mk_dir($xml_path,0777);
}
$xmlFile = fopen($xml_path."/$news_id.xml", "wb+");
/
ar_dump($feedFile);exit;
if ($xmlFile) {
$strxml.= "<content width=\"431\" height=\"542\" >";
//封面
$strxml.="\t\r<page src=\"".SITE_URL."/hrcms/Tpl/default/img/feng2.jpg"."\"/>\t\r";
foreach ($image_arr as $v){
$ni_name = $v["ni_name"];
$strxml.="\t\r<page src=\"".SITE_URL."/".$ni_name."\"/>\t\r";
}
$strxml.="\t\r<page src=\"".SITE_URL."/hrcms/Tpl/default/img/fengdi1.jpg"."\"/>\t\r";
$strxml.= "\t\r</content>";
@fwrite($xmlFile,$strxml);
@fclose($xmlFile);
} else {
$this->error("XML文件写入失败,请检查相关权限");
}
$xml_path = ROOT_DIR.DIRECTORY_SEPARATOR.'/hrcms/Tpl/default/Community/xml';
if(!is_dir($xml_path)){
mk_dir($xml_path,0777);
}
$xmlFile = fopen($xml_path."/$news_id.xml", "wb+");
/
if ($xmlFile) {
$strxml.= "<content width=\"431\" height=\"542\" >";
//封面
$strxml.="\t\r<page src=\"".SITE_URL."/hrcms/Tpl/default/img/feng2.jpg"."\"/>\t\r";
foreach ($image_arr as $v){
$ni_name = $v["ni_name"];
$strxml.="\t\r<page src=\"".SITE_URL."/".$ni_name."\"/>\t\r";
}
$strxml.="\t\r<page src=\"".SITE_URL."/hrcms/Tpl/default/img/fengdi1.jpg"."\"/>\t\r";
$strxml.= "\t\r</content>";
@fwrite($xmlFile,$strxml);
@fclose($xmlFile);
} else {
$this->error("XML文件写入失败,请检查相关权限");
}
Meet so Meet.
C plusplus
I-PLUS....