时间:2021-07-01 10:21:17 帮助过:22人阅读
.html/article/hardware/008.html
http://www.niutuku.com/
http://www.niutuku.com/
http://www.niutuku.com/
3
这个主要涉及到xml DOM的操作吧,去看看这方面的内容吧。
用 xml DOM
if ( file_exists ( 'out.xml' )) { $xml = simplexml_load_file ( 'out.xml' ); foreach ($xml->pic->list as $key => $value) { $attr = (array) $value->attributes (); var_dump($attr['@attributes']['smallinfo']); } } else { exit( 'Failed to open test.xml.' );}这个只能取到里面的值 想改里面的值建议去下个simple_html_dom或者phpQuery
$s =<<< XMLXML;$xml = simplexml_load_string($s);for($i=0; $i .html/article/hardware/008.html
http://www.niutuku.com/
http://www.niutuku.com/
http://www.niutuku.com/
3 pic->list); $i++) { $xml->pic->list[$i] = $i; $t = $xml->pic->list[$i]->attributes(); $t['smallpath'] = $i;}echo $xml->asXML();
0
1
2
3
3