title: PHP: Elegant Way to foreach Over a Subarray of an Associative Array
body: <p>I have an associative array of arrays. The associative array of arrays does not always contain the same sub-arrays. I would like to loop through a particular sub-array if it exists. Is there a more elegant way to do the following code:</p>
  
  <pre><code>if ( array_key_exists( 'fizzy_drinks', $drinks ) ) {
  
      foreach ( $drinks['fizzy_drinks'] as $fizzy_drink ) {
  
          // do something with $fizzy_drink
      }
  }
  </code></pre>