Learn PHP IF Else


PHP If else is very interesting topic when you start programming . If Else is  used to test and create a logic of your website .

If Else is statement and there is various ways to use it :

  • If 
  • If-else
  • elseif
  • nested If 

If statement 

This statement is executable when the condition you applied is true .

For example

 <?php  

if (10 == 10)
{
echo 'true';
}
?>  
  

Output: true 

If  Else statement  

In this statement we check if $a is 10 then write true else write false

<?php
$a=10;
if($a == 10)
{  
   echo "true";
}
else
{  
   else "False"  ;
}  
 

Output: true 


If you want to know more in detail then see this video 

  

Last Updated: 2018-07-06 12:32:44 By akshay

SHARE THIS

share_facebook share_twitter share_google_plus

Please Comment Here :