array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'function.is-float.php', 1 => 'is_float', 2 => 'Finds whether the type of a variable is float', ), 'up' => array ( 0 => 'ref.var.php', 1 => 'Variable handling Функції', ), 'prev' => array ( 0 => 'function.is-double.php', 1 => 'is_double', ), 'next' => array ( 0 => 'function.is-int.php', 1 => 'is_int', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/var/functions/is-float.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

is_float

(PHP 4, PHP 5, PHP 7, PHP 8)

is_floatFinds whether the type of a variable is float

Опис

is_float(mixed $value): bool

Finds whether the type of the given variable is float.

Зауваження:

To test if a variable is a number or a numeric string (such as form input, which is always a string), you must use is_numeric().

Параметри

value

The variable being evaluated.

Значення, що повертаються

Returns true if value is a float, false otherwise.

Приклади

Приклад #1 is_float() example

<?php

var_dump
(is_float(27.25));
var_dump(is_float('abc'));
var_dump(is_float(23));
var_dump(is_float(23.5));
var_dump(is_float(1e7)); //Scientific Notation
var_dump(is_float(true));
?>

Поданий вище приклад виведе:

bool(true)
bool(false)
bool(false)
bool(true)
bool(true)
bool(false)

Прогляньте також