Even or Odd using PHP

<!DOCTYPE html>
<html>
<head>
<title>Even or odd checker</title>
</head>
<body>
<form method="post">
<label for="number">Enter a number:</label>
<input type="text" id="number" name="number"><br><br>
<input type="submit" name="submit" value="Check">
</form>

<?php
if (isset($_POST['submit'])) {
$num = $_POST['number'];

if ($num % 2 == 0) {
echo $num . "is even";
} else {
echo $num . " is odd";
}
}
?>
</body>
</html>