Problem Statement
Which of the following is the correct syntax of an if statement in PHP?
Explanation
PHP supports two syntaxes for if statements. The standard uses braces, and the alternate syntax uses a colon with endif for template files.
Code Solution
SolutionRead Only
if ($x > 10) { echo 'Big'; }
// or
if ($x > 10): echo 'Big'; endif;