if statement - how to use if statement (if condition) in php

if statement - how to use if statement (if condition) in php


ifstatement.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>if statement - how to use if statement (if condition) in php</title>
</head>

<body>
    <h2 style="color:OrangeRed; font-style:italic">php example: using if statement (if condition)</h2>
    <hr width="450" align="left" color="Green" />
    <br />

<?php 
 $Color="Green";
 
 if($Color == "Crimson")
 {
 echo "<div style='Color:Snow;Background-color:$Color;height:125px; width:375px;padding-left:25px;font-size:large;'>";
  echo "<br />";
  echo "selected color is: crimson";
 echo "</div>";
  }
 if($Color == "Green")
 {
 echo "<div style='Color:Snow;Background-color:$Color;height:125px; width:375px;padding-left:25px;font-size:large;'>";
  echo "<br />";
  echo "selected color is: Green";
 echo "</div>";
  }
?>

</body>
</html>