Checking If a String Is Numeric in PHP


Determine if a string is a valid number using is_numeric().

Source Code

$var = "123";
if (is_numeric($var)) {
    echo "$var is numeric.";
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments