Guest User

Untitled

a guest
Apr 25th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. <?php
  2. $str = "0 1 2 3 4 5 6.7 3";
  3. function checkString($string) {
  4. $arr = explode(" ", $string);
  5. foreach($arr as $i) {
  6. if(!is_numeric(trim($i))) {
  7. return false;
  8. }
  9. }
  10. return true;
  11. }
  12. if(checkString($str)) {
  13. echo "Yeah.. it works.";
  14. }
  15. ?>
Add Comment
Please, Sign In to add comment