PHP的XML回显名称

时间:2018-08-29 19:12:00

标签: php xml echo

我有file.xml

<header name="1">
<title>
<text1 name="001"/>
<text2 name="002"/>
</title>
</header>

和php:

<?php
$xml = file_get_contents("file.xml");
echo htmlspecialchars($xml);
?>

如何仅从名称中回显文本,因此结果必须为:001-002

0 个答案:

没有答案