What is If statement?
If the conditions stated are true, the (if
statement) is used to execute the code block. In PHP, these are the most basic and cross-platform statements. The if statement in PHP allows code to be executed only if it meets certain criteria. It is executed if condition is True.
Syntax:-
if (condition) {
code to be executed if condition is true;
}
Examples:-
Output:-
Latest posts by Ashwani Kumar (see all)
- Top 10 DevOps Trainers in the world - October 7, 2023
- What is Cookies and Why it is Used? - May 24, 2023
- TOP trends of transitions in TikTok - May 10, 2023