Search
 
SCRIPT & CODE EXAMPLE
 

PHP

check input value is integer or not in php

// to check the input integer validation we can use is_int() function
Syntax:
is_int(parameter);

$x = 10; //returns true
$x = "123"; //returns false
$x = 12.365; //returns false
$x = "ankur"; //returns false
is_int($x);
Comment

php check if variable is int

// Check if variable is int
$id = "1";

if(!intval($id)){
  throw new Exception("Not Int", 404);
}
else{
	// this variable is int
}
Comment

php check if input is int

$a = 5; //returns true
$a = "5"; //returns false
$a = 5.3; //returns false
is_int($a);
Comment

PREVIOUS NEXT
Code Example
Php :: pdo connexion 
Php :: kill php process 
Php :: wordpress get post time 
Php :: php artisan migrate nothing to migrate 
Php :: get soft deleted data laravel 
Php :: Remove “/public” from Laravel route 
Php :: cut string in php 
Php :: php is variable a number 
Php :: Fatal error: Maximum execution time of 120 seconds exceeded in 
Php :: laravel migration remove unique constraint 
Php :: php date today plus 1 month 
Php :: how to get length of object in php 
Php :: old function use in checkbox selected in laravel blade 
Php :: change laravel mix to run on different port 
Php :: check if array has value php 
Php :: php create 404 error 
Php :: php default timezone 
Php :: alert php 
Php :: west african timezone in php 
Php :: blade switch 
Php :: phpmailer with laravel 
Php :: Google_Service_Calendar Event Date Time 
Php :: is php still used 
Php :: laravel route fallback 
Php :: wp_query limit 1 
Php :: how to mantain text in form after error php 
Php :: get post thumbnail url 
Php :: import session laravel 
Php :: get youtube thumbnail php 
Php :: php get all the mondays of the year 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =