PHP uses if
, else
, and elseif
statements to make decisions in your code based on conditions.
if (condition) { }
to test a condition.elseif
checks another condition if the first was false.else
runs if none of the above conditions were true.==
, !=
, >
, <
, >=
, and <=
.{ }
, even for single statements.