Skip to content

Instantly share code, notes, and snippets.

@ihzarizkyk
Created February 14, 2020 00:30
Show Gist options
  • Save ihzarizkyk/2ecdf524ad59380728eb20f379018128 to your computer and use it in GitHub Desktop.
Save ihzarizkyk/2ecdf524ad59380728eb20f379018128 to your computer and use it in GitHub Desktop.
Function is_numeric PHP
<!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