title: Check availability of time with time slots in php
body: <p>I want to show shop availability status with every half an hour using Php and mysql,</p>
  
  <p>For that i tried with following code which creating time slots for me</p>
  
  <pre><code>$duration="30";
      $start="10:00AM";
      $end="07:00PM";
  
      $start = new DateTime($start);
          $end = new DateTime($end);
          $start_time = $start-&gt;format('H:i');
          $end_time = $end-&gt;format('H:i');
          $i=0;
          while(strtotime($start_time) &lt;= strtotime($end_time)){
              $start = $start_time;
              $end = date('H:i',strtotime('+'.$duration.' minutes',strtotime($start_time)));
              $start_time = date('H:i',strtotime('+'.$duration.' minutes',strtotime($start_time)));
              $i++;
              if(strtotime($start_time) &lt;= strtotime($end_time)){
                  $time[$i]['start'] = $start;
                  $time[$i]['end'] = $end;
              }
          }
          print_R($time);
  </code></pre>
  
  <p>Above code showing following result (creating time slots properly)</p>
  
  <pre><code>Array
  (
      [1] =&gt; Array
          (
              [start] =&gt; 10:00
              [end] =&gt; 10:30
          )
  
      [2] =&gt; Array
          (
              [start] =&gt; 10:30
              [end] =&gt; 11:00
          )
      ...// and so on
  </code></pre>
  
  <p>I want result something like this</p>
  
  <pre><code>Array
  (
      [1] =&gt; Array
          (
              [start] =&gt; 10:00
              [end] =&gt; 10:30
              [status] =&gt; availiable
          )
  
      [2] =&gt; Array
          (
              [start] =&gt; 10:30
              [end] =&gt; 11:00
              [status] =&gt; booked
          )
  </code></pre>
  
  <p>Here is my table "booking" in phpmyadmin</p>
  
  <pre><code>id       shop_id     date        booking_start_time    booking_close_time
  1        3           4-7-2019        10:00                 11:00
  </code></pre>
  
  <p>How can i do this ? Thanks in advance</p>