PHP Nested if Statement

Back to ACP page

Table of Contents

PHP 1 Nested If

<h2>Nested If</h2> <p>You can have if statements inside if statements, this is called nested if statements.</p> <?php $a = 13; if ($a > 10) { echo "Above 10"; if ($a > 20) { echo " and also above 20"; } else { echo " but not above 20"; } } ?>

Example 1

Result View Example

Document

Document in project

You can Download PDF file.

Reference