I just want to know the method to check a PHP variable for any non-numbers and if it also detects spaces between characters? Need to make sure nothing weird gets put into my for
This will return true if there are non-numbers in the string. It detects letters, spaces, tabs, new lines, whatever isn't numbers.
true
preg_match('#[^0-9]#',$variable)