By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

PHP else if vs elseif

A short explanation of the difference between else if and elseif in PHP.

Created: 2012-02-25 18:09

In PHP you can both use else if, and elseif syntax of your if statements, there is practically no difference.

Its been said however, that else if would be the same as the below:

if (condition) {
} else {
  if (condition) {

  }
}

Whether using one above the other would result in any performance gain is unknown, but if so, its likely not my much.

Be sure to check out the Tutorial on If Statements.