title: Determining shop opening times in PHP
body: <p>I'd like to include some text on my website that states whether or not a shop is open based on its opening times. If the shop is open, it says when it's open until. If it's not open, it says when it's next open.</p>
  
  <p>I already have the opening times stored in the following variable:</p>
  
  <pre><code>$opening_times = [
      'Monday' =&gt; ['09:00' =&gt; '17:00'],
      'Tuesday' =&gt; ['09:00' =&gt; '17:00'],
      'Wednesday' =&gt; ['09:00' =&gt; '12:00'],
      'Thursday' =&gt; ['09:00' =&gt; '17:00'],
      'Friday' =&gt; ['09:00' =&gt; '17:00'],
      'Saturday' =&gt; ['09:30' =&gt; '17:00']
  ];
  </code></pre>
  
  <p>The shop is closed on Sunday.</p>
  
  <p>Please could someone guide me as to how I can do this? I've already looked at <a href="https://stackoverflow.com/questions/14904864/determine-if-business-is-open-closed-based-on-business-hours">this example</a> but I'm unsure how to handle showing the time the shop is open next and what to do when it's a Sunday.</p>
  
  <p>I'm hoping to finish with something that displays the next time the shop's open, whether that's on the same day or not. For example, at 5.30pm on Saturday, I'd like the message to say that the shop's next open at 9am on Monday.</p>
  
  <p>I had previously attempted this by storing the next open day and time with each day in the <code>$opening_times</code> variable but I was wondering if there was a more elegant solution.</p>