Advertisement
jeffersonvv

IS_INT

Jun 1st, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. if(is_int(10)){
  2.     echo 'Inteiro';
  3. }else{
  4.     echo 'Não Inteiro';
  5. }
  6.  
  7. echo '<br />';
  8.  
  9. if(is_int('10')){
  10.     echo 'Inteiro';
  11. }else{
  12.     echo 'Não Inteiro';
  13. }
  14.  
  15. echo '<br />';
  16.  
  17. if(is_int(10.5)){
  18.     echo 'Inteiro';
  19. }else{
  20.     echo 'Não Inteiro';
  21. }
  22.  
  23. /* SAÍDA:
  24. Inteiro
  25. Não Inteiro
  26. Não Inteiro
  27. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement