我有一个foreach循环和一个if语句。如果找到匹配项,我最终需要跳出foreach循环。
foreach ($equipxml as $equip) {
$current_device = $equip->xpath("name");
if ($current_device[0] == $device) {
// Found a match in the file.
$nodeid = $equip->id;
<break out of if and foreach here>
}
}