title: How to return only one value if none of foreach iterations match condition
body: <p>I have piece of code like this</p>
  <pre><code>foreach ($item-&gt;offers as $offer) {
      foreach ($json as $akey =&gt; $article){
          if ($article['A'] == $offer-&gt;OfferName){
  
              echo $article['B'];
  
              break;
  
          } else {
  
              echo $offer-&gt;OfferName
  
          }
  
      }
                                      
  }
  </code></pre>
  <p>As you can see I want to loop through offers and see if they exist in json.
  If they exist I want to get value B of article but if not I want just to echo offer name.</p>
  <p>Unfortunately else statement return all of non matching iterations and I have no idea how to force it to return it only once.</p>
  <p>E: I want return some value if none of iterations in second loop is matching given condition.</p>
  <p>Maybe someone familiar with PHP know the solution.</p>
  <p>Thanks.</p>