最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php怎么取读xml文件
时间:2022-07-02 10:11:51 编辑:袖梨 来源:一聚教程网
$doc = new DOMDocument();
$doc->load( 'books.xml' );
$books = $doc->getElementsByTagName( "book" );
foreach( $books as $book )
{
$authors = $book->getElementsByTagName( "author" );
$author = $authors->item(0)->nodeValue;
$publishers = $book->getElementsByTagName( "publisher" );
$publisher = $publishers->item(0)->nodeValue;
$titles = $book->getElementsByTagName( "title" );
$title = $titles->item(0)->nodeValue;
echo "$title - $author - $publishern";
}
?>
相关文章
- 柴犬币进军医疗领域,5000美元牙科账单用迷因币支付 07-13
- 道家经典名句解释162句 07-13
- 魔兽世界永恒长夜护腿在哪里刷-永恒长夜护腿刷取介绍 07-13
- 狗狗币能涨到1美元吗?DOGE创始人这样看 07-13
- ps怎么把黑白照片变成彩色?ps把儿童黑白照变彩色教程 07-13
- 关于命运的经典句子78句 07-13