fork(3) download
  1. <?php
  2. setlocale(LC_ALL, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese');
  3. date_default_timezone_set('America/Sao_Paulo');
  4.  
  5. $mes = strftime('%m');
  6. $meses = range(--$mes, $mes+2);
  7.  
  8. foreach($meses as $item){
  9. echo 'valor: '. $item .' descricao: '. strftime('%B', strtotime('2015-'.$item.'-01')) .PHP_EOL;
  10. }
  11.  
  12.  
  13.  
Success #stdin #stdout 0.03s 24400KB
stdin
Standard input is empty
stdout
valor: 4 descricao: April
valor: 5 descricao: May
valor: 6 descricao: June