function.php 421 B

1234567891011121314151617181920212223242526
  1. <?php
  2. function checkfloat($float,$min=0,$max=999999){
  3. if(!is_float($float)){
  4. return false;
  5. }
  6. if($float<$min or $float>$max){
  7. return false;
  8. }
  9. return true;
  10. }
  11. function checkstrlen($str,$min=1,$max=4){
  12. $strlen = mb_strlen($str,'utf-8');
  13. if($strlen<$min or $strlen>$max){
  14. return false;
  15. }else{
  16. return true;
  17. }
  18. }
  19. function checkint($int){
  20. if(!is_int($int) or $int<0){
  21. return false;
  22. }else{
  23. return true;
  24. }
  25. }