📅  最后修改于: 2022-03-11 14:54:45.853000             🧑  作者: Mango
$xml=simplexml_load_file($file);
foreach($xml->Var[0]->attributes() as $a => $b) {
echo $a,'="',$b,"\"\n";
}
$attr = $xml->Var[0]->attributes();
echo $attr['my_var'];