is_bool

(PHP 4 )

is_bool --  Détermine si une variable est un booléen

Description

bool is_bool ( mixed var)

is_bool() retourne TRUE si var est un boolean.

Exemple 1. Exemple avec is_bool()

<?php
$a
= false;
$b = 0;

// Comme $a est un bool&eacute;en, ceci est vrai
if (is_bool($a)) {
    print
"Oui, c'est un bool&eacute;en";
}

// Comme $b n'est pas un bool&eacute;en, ceci est faux
if (is_bool($b)) {
    print
"Oui, c'est un bool&eacute;en";
}
?>

Voir aussi is_array(), is_float(), is_int(), is_integer(), is_string() et is_object().