PHP case switching

PHP case switching

PHP – Switch case: Switch case can be considered to be like multiple if else statements. Here, the variable “I” is checked first. If it is evaluated to TRUE, the statement after that is executed else the next if condition is evaluated.
if ($i == 0)
{
    echo "i equals 0";
}
elseif ($i == 1)
{
    echo "i equals 1";
}
elseif ($i == 2)
{
    echo "i equals 2";
}
PHP loop
PHP – While loop: while loops check for the expression. If it is evaluated to true, the subsequent statement is executed.
PHP function
PHP has around hundreds of inbuilt for functions which makes it a very powerful language.
PHP data types
PHP supports a number of fundamental basic data types, such as integers, floats, and strings.
Post your comment