title: php - inner foreach not resetting
body: <p>I have already reserached about this but to no luck.</p>
  
  <p>I recently visited <a href="http://php.net/manual/en/control-structures.foreach.php" rel="nofollow noreferrer">http://php.net/manual/en/control-structures.foreach.php</a> and tried to add <code>unset($var)</code> and <code>reset($var)</code> in the inner foreach but both do not reset the $var.</p>
  
  <p>Last question asked about this is about 2 years ago and has also not helped me. Here is the link <a href="https://stackoverflow.com/questions/27882793/php-nested-foreach-loop-iterate-and-set-variable#">PHP nested foreach loop iterate and set variable</a>.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@foreach($employees as $employee)
      @foreach($Users as $user)
          @if($employee-&gt;id == $user-&gt;user_id)
              @break
          @else
              &lt;option value="{{ $employee-&gt;id }}" branch="{{ $employee-&gt;branch }}" department="{{ $employee-&gt;department }}"&gt;{{ $employee-&gt;first_name }} {{ $employee-&gt;last_name }}&lt;/option&gt;
              @break
          @endif
      @endforeach
  @endforeach
  </code></pre>
  
  <p>My expected result would be the list of employee options (can be found in <code>@else</code> portion of the code) without the existing users (<code>@if</code> part of the code).</p>
  
  <p>My code only skips the first existing user. I expect four of them to be skipped.</p>
  
  <p>I am using Laravel by the way.</p>