hercioneto

verificacoes.php

Apr 22nd, 2019
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1. <?php
  2. //verificacoes.php
  3.  
  4. function Verifica($idade, $sexo)
  5. {
  6.     $retorno = "Não";
  7.     if ($sexo == "M") {
  8.         if ($idade >= 65) {
  9.             $retorno = "Sim";
  10.         }
  11.         else {
  12.             $retorno = "Não"; 
  13.         }
  14.  
  15.     } else {
  16.         if ($idade >= 60) {
  17.             $retorno = "Sim";
  18.         }
  19.         else {
  20.             $retorno = "Não"; 
  21.         }          
  22.     }
  23.     return $retorno;
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment