title: how to get all the dates between custom dates?
body: <p>i make a php page in which custom dates are selected i want to get dates between them in an array?here is my code:</p>
  
  <pre><code>$startdate1=date('Y-m-d h:i:s',strtotime($_POST['registration_opens_date']));
  $enddate1=date('Y-m-d h:i:s',strtotime($_POST['registration_ends_date']));
  </code></pre>
  
  <p>i used this method but not work for me</p>
  
  <pre><code>$begin = $startdate1;
  $end = $enddate1;
  
  $daterange = new DatePeriod($begin, new DateInterval('P1D'), $end);
  
  foreach($daterange as $date){
    echo $date-&gt;format("Y-m-d") . "&lt;br&gt;";
  }
  </code></pre>
  
  <p>i want to get dates between $startdate1 and $enddate1,how i get dates between them?</p>