fork download
  1. <?php
  2.  
  3. $output ="";
  4. $semana = array(
  5.  
  6. '1' => 'Segunda-Feira',
  7. '2' => 'Terca-Feira',
  8. '3' => 'Quarta-Feira',
  9. '4' => 'Quinta-Feira',
  10. '5' => 'Sexta-Feira',
  11. '6' => 'Sábado',
  12. '7' => 'Domingo'
  13. );
  14.  
  15. $a = array_slice($semana, date('w') - 1 );
  16.  
  17. $b = array_slice($semana, 0 , date('w') - 1 );
  18.  
  19. $c = array_merge_recursive( $a , $b );
  20.  
  21. foreach( $c as $key => $value ) {
  22.  
  23. $output = $output . "\n". $value ;
  24. }
  25.  
  26.  
  27.  
  28. echo $output;
Success #stdin #stdout 0.01s 83904KB
stdin
Standard input is empty
stdout
Domingo
Segunda-Feira
Terca-Feira
Quarta-Feira
Quinta-Feira
Sexta-Feira
Sábado