日期:2014-05-17 浏览次数:20448 次
$xml = '<?xml version="1.0" encoding="utf-8"?>'."\r\n"; $xml .= '<user>'."\r\n"; $xml .= "\t".'<person_siteurl>'.www.163.com.'</person_siteurl>'."\r\n"; foreach (array(1,2,3) as $value){ $xml .= "\t".'<job_keys>'.$value.'</job_keys>'."\r\n"; } $xml .= '</user>'."\r\n"; $sxe = new SimpleXMLElement($xml); $sxe->asXML(APPPATH.'user.xml');
$sxe = new SimpleXMLElement($xml); $sxe->addChild('username', '李四'); $sxe->asXML(APPPATH.'user.xml');