我有一个看起来像这样的 XML 文件
<table id="0">
</table>
<table id="1">
</table>
<table id="2">
</table>
我想检查一个 id x 的表是否存在
我一直在尝试这个,但没有用。
$file=fopen("config.xml","a+");
while (!feof($file))
{
if(fgets($file). "<br>" === '<table id="0">'){
echo fgets($file). "<br>";
}
}
fclose($file);