Hi Friends
I was working on yii2 framework project in which i as working on delivery date in which it should skip shipping or delivery date on sunday as saturday is also working day,so i came up with idea to validate the number of delivery day from current day by validating sunday in that number of date and add one day if it comes across Sunday.
Example:
<?php
for ($i = 0; $i < $maxShiping; $i++) {
if(date('l', time() + 86400 * $i)=='Sunday'){
$maxShiping = $maxShiping+1;
}
}
How to validate sunday date or skip sunday date in php
Tagged with: date(), for, php, saturday, skip sunday, sunday, time, validate sunday, yii2
Posted in php
Posted in php
Leave a comment