1. Computing & Technology

Discuss in my forum

Elseif () PHP Function

By , About.com Guide

Definition: As it's name implies, elseif () works similar to if () and else () statements. However, using elseif () gives you more than two possible outcomes. Unlike else () which executes in all cases the if () is false... elseif () only executes if the statement is true.
Also Known As: Else If
Examples:
 <?php 
 if ($x > $y) 
 { 
 echo "x is larger than y"; 
 } 
 elseif ($x == $y) 
 { 
 echo "x is equal to y"; 
 } 
 else 
 { 
 echo "x is smaller than y"; 
 } 
 ?> 
Related Searches lt

©2012 About.com. All rights reserved.

A part of The New York Times Company.