<?php
for ($count=0; $count <= 10; $count++) {
if ($count % 2 != 0) {
continue; //Tells PHP to skip back to the top when $count = 5 and ignore the "echo $count" statement below it.
//This loop will output all of the numbers between 0 and 10, skipping 5.
}
echo $count . ".
";
}
?>
<?php
// Recursive function to check whether
// the number is Even or Odd
// https://www.geeksforgeeks.org/php-check-number-even-odd/
function check($number){
if($number == 0)
return 1;
else if($number == 1)
return 0;
else if($number<0)
return check(-$number);
else
return check($number-2);
}
// Driver Code
$number = -39;
if(check($number))
echo "Even";
else
echo "Odd";
?>
<?php
// PHP code to check whether the number
// is Even or Odd using Bitwise Operator
// https://www.geeksforgeeks.org/php-check-number-even-odd/
function check($number)
{
// One
$one = 1;
// Bitwise AND
$bitwiseAnd = $number & $one;
if($bitwiseAnd == 1)
{
echo "Odd";
}
else{
echo "Even";
}
}
// Driver Code
$number = 39;
check($number)
?>