title: PHP compare two arrays of dates and check for match
body: <p>I want have two <code>arrays</code> with date objects which I want to compare. The first array contains todays date and the next five days:</p>
  
  <pre><code>$today = date('Y-m-d');
  $fiveDays = [];
  for($i=0; $i &lt;= 5; $i++){
      $today = date('Y-m-d', strtotime('+1 day', strtotime($today)));
      $fiveDays[] = date('Y-m-d', strtotime($today));
  }
  </code></pre>
  
  <p>which gives the result:</p>
  
  <pre><code>0: "2018-09-14"
  1: "2018-09-15"
  2: "2018-09-16"
  3: "2018-09-17"
  4: "2018-09-18"
  5: "2018-09-19"
  </code></pre>
  
  <p>the other array can contain multiple objects:</p>
  
  <pre><code>[{
     days: (4) ["2018-09-13", "2018-09-14", "2018-09-15", "2018-09-16"]
     duration: 4
     end: "2018-09-16"
     name: "vacation blabla"
     start: "2018-09-13"
  },
  {
     days: (5) ["2018-09-20", "2018-09-21", "2018-09-22", "2018-09-23", "2018-09-24"]
     duration: 5
     end: "2018-09-24"
     name: "vacation blabla"
     start: "2018-09-20"
  }]
  </code></pre>
  
  <p>Now I want to check if one of the days/dates of the first array will or is in the vacations_array. How can I achieve that?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>When a match is found, the second array(with the vacation-periods) where the match is true, must be assigned to a <code>$vacation</code>-array</p>