web-profile

php odd even

Check if number is odd or even:

<?php
if ($i % 2) {
	echo "$i is odd";
} else {
	echo "$i is even";
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *