Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between else if and elseif [duplicate]

Possible Duplicate:
underlying difference between elseif vs else if

What is the difference between PHP conditions else if and elseif ...

<?php

....

else if($count == 4) {}

and

elseif($count == 4) {}

Is there any special case to use one or not? Thanks!!

like image 878
Madan Sapkota Avatar asked Dec 20 '25 09:12

Madan Sapkota


1 Answers

With curly braces, it makes no difference. When using a colon to define your conditions, 'else if' will fail due to parse error.

See here for more details.

like image 84
PlantTheIdea Avatar answered Dec 22 '25 23:12

PlantTheIdea



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!