How to validate sunday date or skip sunday date in php


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;
}
}

About

myself pramodh kumar yet another php developer from India and have worked on oops,procedural,yii framework,codeigniter,wordpress,joomla,api and more.

Tagged with: , , , , , , , ,
Posted in php

Leave a comment

Follow Tutorial on WordPress.com
categories
Calendar
November 2017
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
Follow me on Twitter
Blog Stats
  • 88,191 hits