PHP Conditional Statements Part – 1

Program 1

<html>
    <head><title>PHP Condtional Operator Operators</title>
    <body>
     <center>
  
<?php
       $n=1;  // 1 to 5
       if($n==1)         
         echo " One";
         if($n==2)         
         echo " Two";
         if($n==3)         
         echo " Three";
         if($n==4)         
         echo " Four";
         if($n==5)         
         echo " Five";
           if($n<1 or $n>5)  
         echo " Invalid number";
       
       
       /* 
          if

          if(condition)
          {
              // Statements 
          }



          if else
          if elseif
          switch case
       */
?>
</center>
</body>
</html>

 

courses

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

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