tags:

views:

97

answers:

2
+1  A: 

you can look at

http://php.net/manual/en/control-structures.elseif.php

Haim Evgi
Thank you, Haim.
Francisc
@francisc your welcome
Haim Evgi
A: 

An if/else statement is used to check a single condition. An if/elseif/else statement is useful when you have several conditions, but you can also solve that problem with a switch, like this:

<?php
if ($i == 0) 
{
    echo 'i equals 0';
}
elseif ($i == 1)
{
    echo 'i equals 1';
} 
elseif ($i == 2)
{
    echo 'i equals 2';
}

switch ($i) 
{
    case 0:
        echo 'i equals 0';
        break;
    case 1:
        echo 'i equals 1';
        break;
    case 2:
        echo 'i equals 2';
        break;
}
?>

Which one you want to use is up to you.

Evert