最新下载
热门教程
- 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";
}
?>
相关文章
- 《前往中世纪》房间介绍 04-03
- 歪歪漫画-免费在线看漫画 04-03
- 《前往中世纪》食品变质介绍 04-03
- 文件传输助手删除的文件如何恢复 04-03
- 羞羞漫画秋蝉入口直达-秋蝉漫画无删减版在线观看入口 04-03
- 小红书网页版登录页面怎么找 04-03