PHP Control Structure

In normal program execution is done in order in which they have been written.
But sometimes we have to change path of execution of code and this is done by using control structure.
PHP Control structure is block of code that decides the execution path of a program .

PHP script is series of statements. These statements can be variable, expression, functions call, loop, assignment or control statements. Sometimes the group of statements form statement-group within curly braces to perform some particular task.

As in many languages there is need of control statements like if, if-else, switch etc.
In PHP there also following important control structures:

We explain each control structure in next chapters in detail with flowchart, example and syntax of each.

Help others by sharing the content!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.