note 124359 deleted from control-structures.alternative-syntax by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 14:36:13 +0000 |
| Subject: | note 124359 deleted from control-structures.alternative-syntax by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215217@lists.php.net to get a copy of this message | ||
Note Submitter: jfo at drcloudemr dot com
----
I realize that this is an old thread, but the real problem is that
if (isset($foo)): echo "Both are set.";
is missing an "endif;"
if (isset($foo)): echo "Both are set."; endif;
<?php
$foo = 'foo';
$bar = 'bar';
if (isset($bar)):
if (isset($foo)): echo "Both are set."; endif;
elseif (isset($foo)):
echo "Only 'foo' is set.";
else:
echo "Only 'bar' is set.";
endif;