|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-07-18 11:47 UTC] mark at pictura-dp dot nl
I think nothing's wrong with the following syntax:
<?php
$foo="bug?";
if($foo=="nobug"):
echo "No Bug :)";
elseif(substr($foo,0,3)=="bug"):
if($foo=="bug?") {
echo "Bug :(";
}
else:
echo "No problem!";
endif;
?>
But it results in a parse error, unexpected ':'.
Mark Lindeman
the Netherlands
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 12:00:01 2025 UTC |
Don't mix styles. If you use the old, ugly style of 'if () : endif;' stick to that, but don't try mix it with 'if () { }'