PHP Magic Book – Free PHP Scripts, Tutorials and Downloads, PHP AtoZ Reloaded, free php tutorials, free php downloads, php scripts, PHP tips

Archive for the ‘ Else ’ Category

PHP Else Statement

To understand else statement consider following example.

(more…)

Tags:
Posted in: Else, PHP Basics
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

Elseif Conditions in PHP

This example is based on if elseif and else. It is as simple as telling script to do something if it finds A, If A is not present then look for B and if B is found then do something else. But if A and B are not found and there is something other then do anything else for all other cases.

An if/else statement is great if you only need to check for one condition. However, what would you do if you wanted to check whether its a morning, evening or afternoon. Consider following example.

(more…)

Tags: , ,
Posted in: Conditions, Else, Elseif, PHP Basics, if
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

    


  Subscribe Via RSS
  Subscribe Via Email