Our blog

 

PHP Next Working Day

Here's a nice little PHP snippet for you. The next weekday as a DD/MM/YYYY string:

PHP:
  1. <?php
  2. if(preg_match('%(Sat|Sun|Fri)%', date('D'))){
  3.     $next_working_day = date('d/m/Y', strtotime('next Monday'));
  4. }else{
  5.     $next_working_day = date('d/m/Y', strtotime('+1 day'));
  6. }
  7. echo $next_working_day;
  8. ?>

More Reading:

 

Leave a Reply