Search
 
SCRIPT & CODE EXAMPLE
 

PHP

check if string is number or not php

$var_num = "1";
$var_str = "Hello World";

var_dump( is_numeric($var_num), is_numeric($var_str) );

/* 
Output -
 bool(true)
 bool(false)
*/
Comment

php check if string or number

 <?php if (is_numeric(887)) { echo "Yes"; } else { echo "No"; } ?>
Comment

php check if string or number

 <?php if (is_numeric("cake")) { echo "Yes"; } else { echo "No"; } ?>
Comment

PREVIOUS NEXT
Code Example
Php :: php regex only number 
Php :: php console log 
Php :: php foreach reverse 
Php :: get all values inside session laravel 
Php :: Root composer.json requires php ^7.2.5 but your php version (8.0.6) does not satisfy that requirement. 
Php :: None of the supported PHP extensions (PgSQL, PDO_PgSQL) are available. 
Php :: homebrew install php 7.4 
Php :: laravel migation error 
Php :: smarty prestashop get language 
Php :: In PackageManifest.php line 131: Undefined index: name laravel 7 
Php :: php header pdf open in browser 
Php :: php str_replace 
Php :: php generate random string fixed length 
Php :: download php7.4-mbstring ubuntu 
Php :: laravel redirect external url 
Php :: php connect to postgresql 
Php :: php foreach first element 
Php :: laravel carbon get year number 
Php :: php remove quotes 
Php :: string contains php 
Php :: gd extension docker php 
Php :: laravel 9 route controller group 
Php :: Class "BarryvdhLaravelIdeHelperIdeHelperServiceProvider" not found 
Php :: php check if non-object 
Php :: php get day from date 
Php :: php switch 
Php :: wp max revisions 
Php :: cast array to object php 
Php :: laravel get list of columns in a table 
Php :: laravel where creation is today carbon 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =