If-Else Example

<?php
$marks = 75;

if ($marks >= 50) {
echo "You passed!";
} else {
echo "You failed!";
} ?>

Explanation:

  • If condition is true, “You passed!” will be printed.
  • Otherwise, “You failed!” is shown.

Comments

Leave a Reply

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