array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'function.is-float.php', 1 => 'is_float', ), 'up' => array ( 0 => 'ref.var.php', 1 => 'Funktionen zur Behandlung von Variablen', ), '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' => 'de', 'path' => 'reference/var/functions/is-float.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
is_float — Prüft, ob eine Variable vom Typ float ist
Prüft, ob eine Variable vom Typ float ist
Hinweis:
Um zu testen, ob eine Variable eine Zahl oder eine numerische Zeichenkette ist (wie zum Beispiel Formularangaben, die immer Zeichenketten sind), müssen Sie is_numeric() verwenden.
value
Die auszuwertende Variable.
Beispiel #1 is_float()-Beispiel
<?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));
?>
Das oben gezeigte Beispiel erzeugt folgende Ausgabe:
bool(true) bool(false) bool(false) bool(true) bool(true) bool(false)