Quick tutorial: php if and else

Filed under: PHP

The if construct is an important feature of many programming languages, allowing for particular code to be excuted depending on certain conditions.

The basic way of using the if construct is:


if (condition) {
   do this if the condition is satisfied or is true;
}

You can include an else construct to execute different code if the condition is not met. (Read more…)