note 37170 added to control-structures.alternative-syntax
| From: | StarLight at rn2 dot php dot net | Date: | Wed, 05 Nov 2003 16:59:37 +0000 |
| Subject: | note 37170 added to control-structures.alternative-syntax | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-59954@lists.php.net to get a copy of this message | ||
In response to justin at iqmail dot net note, the parse error is because of lazy coding and has
nothing to do with mixing syntax ;-). You should put a semicolon at the end of the second multi-line
if. This works and didn't bark (tested on php 4.0.3pl1):D
<?php
if (condition):
// code
if (another_condition) {
// multi-line code
}; //notice the semicolon
else:
?>
[html here]
<?php
endif;
?>
best regards,
StarLight
----
Manual Page -- http://www.php.net/manual/en/control-structures.alternative-syntax.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37170
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37170&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37170&report=yes
Search -- http://master.php.net/manage/user-notes.php