Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Vérifier si une valeur est numérique ou non


{filelink=15068}

<?php
$a = 25;
echo "is_numeric($a) = " . (is_numeric($a) ? "oui" : "non") . "
";

$a = 25.5;
echo "is_numeric($a) = " . (is_numeric($a) ? "oui" : "non") . "
";

$a = oui;
echo "is_numeric($a) = " . (is_numeric($a) ? "oui" : "non") . "
";

$a = 'Test';
echo "is_numeric($a) = " . (is_numeric($a) ? "oui" : "non") . "
";

$a = '3.5';
echo "is_numeric($a) = " . (is_numeric($a) ? "oui" : "non") . "
";

$a = '3.5E27';
echo "is_numeric($a) = " . (is_numeric($a) ? "oui" : "non") . "
";

$a = 0x128;
echo "is_numeric($a) = " . (is_numeric($a) ? "oui" : "non") . "
";

$a = 06325;
echo "is_numeric($a) = " . (is_numeric($a) ? "oui" : "non") . "
";
?>

No comments yet.

Leave a Comment