fork(1) download
  1. <?php
  2. function is_number($n = null){
  3. if (is_null($n)){
  4. return false;
  5. }
  6. if (is_int($n)){
  7. return true;
  8. }
  9. $n = $n.'';
  10. $decimal = explode('.',$n);
  11. if (is_int($decimal[0]*1) && is_int($decimal[1]*1)){
  12. return true;
  13. }
  14.  
  15. return false;
  16.  
  17. }
  18.  
  19. if (is_number(1.2)){
  20. echo "yes";
  21. }
  22. else{
  23. echo "no";
  24. }
  25.  
  26. // your code goes here
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
yes