![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
相关问题
CODE: /***********$file的内容*******/ <books ID="1"> <book ID="01"> <author>Jack1</author> <title>PHP Hacks</title> <publisher>O'Reilly</publisher> </book> </books> /****************/ <?php if (!$dom = domxml_open_file($file)) { echo "Error while parsing the document\n"; exit; } $root = $dom->document_element(); if ($attribute = $root->get_attribute_node('ID')) { echo 'ID is: ' . $attribute->value() . "\n"; } ?> |
我用get_attribute_node或者get_attribute()的时候 得到始终只有根元素books的ID属性值,我怎么才能的到子节点book的ID属性的值 请各位大哥 大姐赐教!!!
提问者:maplegrace 08-22 08:08
答复

