最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
简短的php读取xml详细代码
时间:2022-11-14 23:01:46 编辑:袖梨 来源:一聚教程网
$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 - $publisher ";
echo "
";
}
?>
xml文件
Jack Herrington
Jack Herrington
相关文章
- ao3网页版进入链接分享2024 05-11
- 2024创造与魔法饲料大全 05-11
- 时空中的绘旅人路辰CR浮虹怎么样 05-11
- 以闪亮之名六星套装绮梦星河怎么样 05-11
- 时空中的绘旅人罗夏CR醺染怎么样 05-11
- 以闪亮之名五星套装甜蜜梦魇怎么样 05-11