Skip to main content

Posts

Showing posts with the label flow control in php

PHP Control Flow (if...elseif....else)

        PHP starts with many strengths in its logical and bitwise operators. PHP then extends the ideas of C, Java and Perl control of flow and looping functionality - giving them more of the ease of use associated with Visual Basic or Ruby. Also enhancing the functionality of its associative array, PHP has some powerful control commands with  list() ,  each()  and  foreach() .          Finally, PHP takes full advantage of its mixed type capability for variables and functions. Thus functions like  fopen()  return a value (a file handle in the case of  fopen()  finding a file for opening) or the Boolean  false  if no file was found. Developers have to be alert to these different Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this. In PHP we have the following conditional statements: if statement  - use this statement to execute some code only if a specified condit