fork(5) download
  1. <?php
  2.  
  3. $dataAtual = "2017-05-20";
  4. $date_crl = "2017-04-10";
  5.  
  6.  
  7.  
  8. $time_atual = strtotime($dataAtual);
  9.  
  10. $time_expira = strtotime($date_crl);
  11.  
  12. $dif_tempo = $time_expira - $time_atual;
  13.  
  14. $dias = (int)floor( $dif_tempo / (60 * 60 * 24));
  15.  
  16. if ($dias <= 30 && $dias > 0){
  17. echo "ALERTA";
  18. }elseif($dias<0){
  19. echo "VENCIDO";
  20. }else{
  21. echo "VIGENTE";
  22. }
Success #stdin #stdout 0.01s 83136KB
stdin
Standard input is empty
stdout
VENCIDO