![]() |
The is_numeric() function is an inbuilt function in PHP which is used to check whether a variable passed in function as a parameter is a number or a numeric string or not. The function returns a boolean value. Syntax: bool is_numeric ( $var ) |
Follow the example.
Example:
PHP
<?php
$num = 12;
if (is_numeric($num)) {
echo $num . " is numeric";
}
else {
echo $num . " is not numeric";
}
?>
How to add is_numeric() Function in PHP | PHP String Tutorial |
Read Full: | PHP String Tutorial |
Category: | Web Tutorial |
Sub Category: | PHP String Tutorial |
Uploaded by: | Admin |
Views: | 116 |
Reffered: https://www.geeksforgeeks.org/php-is_numeric-function/