Horje
How to check if string is_numeric() Function in PHP | PHP String Code
How to check if string is_numeric() Function in PHP

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 )

How to add is_numeric() Function in PHP

Follow the example.

index.php
Example: PHP
<?php
 
$num = 12;
if (is_numeric($num)) {
        echo $num . " is numeric";
    }
    else {
        echo $num . " is not numeric";
    }
 
?>

Output should be:

How to add is_numeric() Function in PHP



Read Full::
PHP String Code
Category:
PHP Tutorial Code
Sub Category:
PHP String Code
Uploaded:
1 month ago
Uploaded by:
Admin
Views:
1

Related Articles
How to extract words from Sentence in PHP PHP String Code
How to check if string is_numeric() Function in PHP PHP String Code

Single Articles
How to add is_numeric() Function in PHP

Share on: