最新下载
热门教程
- 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";
}
?>
相关文章
- 超灵秘法社debug模式开启教程 debug模式怎么开 11-21
- 流放之路S24自伤BD不用尘埃落定珠宝启动方法详解 11-21
- 封神演义爱藏版攻略大全 隐藏技能/洞府挑战/隐藏道具/属性效果详解 11-21
- 三国杀武将台词合集2025 三国杀(最惊艳的)台词一览表最新 11-21
- dnf领悟巅峰黄金神树光环外观及属性一览 11-21
- 七日世界呢喃狂犬BOSS打法攻略 11-21