Last active
April 21, 2017 01:15
-
-
Save globalideias/65f06be31591af44bfd7e349e1f41774 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /*$labels = [ | |
| "Mon", | |
| "Tue", | |
| "Wed", | |
| "Thu", | |
| "Fri", | |
| "Sat", | |
| "Sun"];*/ | |
| function diaProximoDiaUtil($data = "00/00/0000"){ | |
| //echo $data . "<br/>"; | |
| $time = strtotime(str_replace("/","-",$data). ' + 1 day'); | |
| $dia_do_ano = date("z",$time); | |
| $label_dia = date("D",$time); | |
| //echo date('Y-m-d',$time); | |
| $labels_FDS = [ | |
| "Sat", | |
| "Sun"]; | |
| if(in_array($label_dia,$labels_FDS)){ | |
| return diaProximoDiaUtil(date('d/m/Y',$time)); | |
| }else{ | |
| return date('d/m/Y',$time); //Deu Certo | |
| } | |
| } | |
| echo diaProximoDiaUtil("21/04/2017"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment