Kh_Mehran said:
Shakeel Bhai Very Nice I have no Word Which for your Admiration
Shakeel bhai aik problem hay
agar text field kay under user ko integer data type kay say other data type ko ristrict kernay kay liay kia php code ho ga
Thanks Kh_Mehran
is kay leay buhat saray mumkin validations app bana saktay hain jin main chand aik ya hain.
PHP Code:
//solution no 1
$number = 1232132;
if(!is_int($number)) {
die("Wrong value");
}
//solution no 2
$number = "22665";
if(!is_numeric($number)) {
die("Number required");
}
//solution no 3
$number = intval(trim($_POST['num']));
if(empty($number)){
die("Invalid Value");
}
//solution no 4
$number = (int) trim($_POST['num']);
if(empty($number)){
die("Invalid Value");
}
(int) or intval() app par chukay hain, empty(), is_int(), is_numeric() app class-14 main InshaAllah tafseel say parain gay.
Bookmarks