Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $str = "0 1 2 3 4 5 6.7 3";
- function checkString($string) {
- $arr = explode(" ", $string);
- foreach($arr as $i) {
- if(!is_numeric(trim($i))) {
- return false;
- }
- }
- return true;
- }
- if(checkString($str)) {
- echo "Yeah.. it works.";
- }
- ?>
Add Comment
Please, Sign In to add comment