PHP is_int() İşlevi
❮ PHP Değişken İşleme Referansı
Örnek
Bir değişkenin tamsayı türünde olup olmadığını kontrol edin:
<?php
$a = 32;
echo "a is " . is_int($a) . "<br>";
$b = 0;
echo "b is "
. is_int($b) . "<br>";
$c = 32.5;
echo "c is " . is_int($c) . "<br>";
$d = "32";
echo "d is " . is_int($d) . "<br>";
$e = true;
echo "e is " . is_int($e) . "<br>";
$f = "null";
echo "f is " .
is_int($f) . "<br>";
?>
Tanım ve Kullanım
is_int() işlevi, bir değişkenin tamsayı türünde olup olmadığını kontrol eder.
Bu işlev, değişken tamsayı türündeyse true (1), aksi takdirde false döndürür.
Sözdizimi
is_int(variable);
Parametre Değerleri
Parameter | Description |
---|---|
variable | Required. Specifies the variable to check |
Teknik detaylar
Geri dönüş değeri: | Değişken bir tamsayı ise DOĞRU , aksi takdirde YANLIŞ |
---|---|
İade Türü: | Boole |
PHP Sürümü: | 4.0+ |
❮ PHP Değişken İşleme Referansı