Problem Description
I have a foreach loop and an if statement. If a match is found I need to ultimately break out of that foreach and if.
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>
}
}
AI-Generated Solution
Powered by LMSouq AI · GPT-4.1-mini
Analyzing problem and generating solution…
Was this solution helpful?