编辑:
抱歉,这是对的,我不得不尝试,但它对我来说听起来不错,谢谢,不管怎样xD我正在尝试制作循环并同时从中调用:
$xml = simplexml_load_file('xml.xml');
$cats = ('Cat2','Cat2');
foreach($cats as $cat){
$call1 = $xml->$cat;
// it supposed to get all cats contents .. now i want to call what is inside the cat
foreach($call1 as $call2){
$call = $call2->somethingelse;
}
}
怎么可能?
答案 0 :(得分:1)
只有当$ arr2是PHP可以迭代的东西(例如数组)时,这才有效。