title: break out of if and foreach
body: <p>I have a foreach loop and an if statement. If a match is found i need to ultimately break out of the foreach.</p>
  <pre><code>foreach ($equipxml as $equip) {
  
      $current_device = $equip-&gt;xpath(&quot;name&quot;);
      if ($current_device[0] == $device) {
  
          // Found a match in the file.
          $nodeid = $equip-&gt;id;
  
          &lt;break out of if and foreach here&gt;
      }
  }
  </code></pre>