If conditions in PHP

It is possible to define execution of different code based on the conditions. The conditions (yes there could be more then one condition) need to evaluate to true in order for the code within that condition to be executed.

If that condition evaluates to false, then the code within elseif or else sections will be executed.

elseif section specifies a different condition. elseif section is optional. Code within elseif section will be executed in case when that condition evaluates to true.

There maybe more than one elseif section.

Another optional section of the code is else section. It is the last section in the if statement. else section is executed in case when all prior conditions evaluate to false.

Comments

Popular posts from this blog

Absolute and relative path in HTML pages

Errors

goto PHP operator