Created
February 14, 2020 00:30
-
-
Save ihzarizkyk/2ecdf524ad59380728eb20f379018128 to your computer and use it in GitHub Desktop.
Function is_numeric PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>General PHP</title> | |
</head> | |
<body> | |
<fieldset> | |
<legend>FORM INPUTAN</legend> | |
<form method="post" action="general.php"> | |
Masukkan Inputan : <input type="text" name="inputan" required><br> | |
<input type="submit" name="submit" value="hasil"> | |
</form> | |
</fieldset> | |
<br> | |
<?php | |
$input = $_POST['inputan']; | |
if(is_numeric($input)){ | |
echo "Yang anda masukkan adalah number"; | |
}else{ | |
echo "Yang Harus anda inputkan adalah number"; | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment