Horje
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
Reffered: https://www.geeksforgeeks.org/php-is_numeric-function/





Related Articles
How to check if a string contain multiple specific words PHP String Tutorial
How to extract words from Sentence in PHP PHP String Tutorial
How to check if string is_numeric() Function in PHP PHP String Tutorial
How to get only text from HTML Source Code by PHP PHP String Tutorial
How to get first 3 words from a sentence by PHP PHP String Tutorial
How to work if empty value does not else PHP String Tutorial
How to remove first Five Line from a TXT File in PHP PHP String Tutorial
How to get Longest Word from a Sentence in PHP PHP String Tutorial
How to remove first character from string php PHP String Tutorial
How to count if Number is below than 10 sum PHP String Tutorial
How to get back page link PHP String Tutorial
How to get first 3 longest words from a sentence PHP PHP String Tutorial
How to count number of words from sentence in PHP PHP String Tutorial

Single Articles
How to add is_numeric() Function in PHPPHP String Tutorial

Read Full:
PHP String Tutorial
Category:
Web Tutorial
Sub Category:
PHP String Tutorial
Uploaded:
10 months ago
Uploaded by:
Admin
Views:
55



Share on: