Possible duplicate:the main difference between elseif vs else if
What is the difference between php else if and elseif conditions ...
else if
elseif
<?php
....
else if($count == 4) {}
and
elseif($count == 4) {}
Is there any special case to use it or not? Thanks!!
With curly braces, this does not matter. If you use a colon to determine your conditions, an "else if" will fail because of a parsing error.
See here for more details .
Logically, they are exactly the same.
They can be interpreted differently by the parser, which can lead to very small differences in performance.