Exécuter
❯
Exécuter le code
Ctrl+Alt+R
Changer d'orientation
Ctrl+Alt+O
Changer de thème
Ctrl+Alt+D
<!DOCTYPE html> <html> <body> <h2>La fonction PHP is_numeric()</h2> <p>Vérifiez si la variable est un nombre ou une chaîne numérique :</p> <?php $x = 5985; var_dump(is_numeric($x)); echo "<br>"; $x = "5985"; var_dump(is_numeric($x)); echo "<br>"; $x = "59.85" + 100; var_dump(is_numeric($x)); echo "<br>"; $x = "Bonjour"; var_dump(is_numeric($x)); ?> </body> </html>
La fonction PHP is_numeric()
Vérifiez si la variable est un nombre ou une chaîne numérique :
bool(true)
bool(true)
bool(true)
bool(false)