Apply this code:
<?php $no_of_day = 10; for($i= 1; $i <= $no_of_day; $i++) { $start_date = date('Y-m-d H:i:s',strtotime("+".$i." month")); if(date('D', strtotime($start_date)) == "Sat") { $start_date = date('Y-m-d H:i:s',strtotime("+1 days", strtotime($start_date))); } if(date('D', strtotime($start_date)) == "Sun") { $start_date = date('Y-m-d H:i:s',strtotime("+1 days", strtotime($start_date))); } $nameOfDay = date('D', strtotime($start_date)); echo $nameOfDay."<br>"; } ?>
Hope it will be helpful for you.
Question and answer is powered by AnsPress.io