<?php 
include("dbConfig.php");
$taked_dates = array();
$sql_taked="SELECT * FROM hr_takeed_hodor_ensraf_tbl where  employ_id='271562'";
$result_taked = $conn->query($sql_taked);
                        if ($result_taked->num_rows > 0) {
                          while($row_taked = $result_taked->fetch_assoc()) {

$begin = new DateTime($row_taked["date_from"]);
$end = new DateTime($row_taked["date_to"]);

$dayblus = date_add($end,date_interval_create_from_date_string("1 days"));
echo date_format($dayblus,"Y-m-d")."</br>";

$daterange = new DatePeriod($begin, new DateInterval('P1D'), $end);

foreach($daterange as $date){
    //echo $date->format("Y-m-d") . "<br>";
    
//echo date_format($date,"Y-m-d");
    array_push($taked_dates,$date->format("Y-m-d"));
}
                          }}
                         // print_r($taked_dates);
?>