这有点什么我的XML看起来像:导入XML,不接受“ - ”在XML标签
<?xml version="1.0" encoding="UTF-8"?>
<citizen>
<military>
<rank-points>62750</rank-points>
<stars>1</stars>
<total-damage>18243</total-damage>
<rank>Commander</rank>
<fight-count>0</fight-count>
</military>
</citizen>
现在,我要导入的标签“等级分”里面的东西PHP使用
$rank = $xml->{'military'}->rank-points;
但是,因为XML标签名称中有一个“ - ”,它将不起作用。其结果是始终为0