Category PHP

Continue Statement in PHP

An example of execution style of continue statement in PHP.

The continue statement in PHP is also a control flow statement similar to break statement except that it only stops the current execution of loop instead of stopping the entire loop. The continue statement is used to skip the current…

Break Statement in PHP

The break statement in PHP is a control flow statement used to exit the current loop iteration or stop the entire loop prematurely. You can use the break statement to control the flow of execution within loops such as for,…

Do While Loop in PHP

Flowchart diagram of PHP do while loop.

The do-while loop in PHP or any other programming languages is just an opposite of the while loop. Its function is exactly like an ordinary while loop, with only one key difference: The while loop evaluates the condition before executing…

While Loop in PHP

Flowchart diagram of while loop in PHP

The while loop in PHP programming language is the simplest type of loop statement that repeats a block of code or a target statement(s) as long as the specified condition remains true. In simple terms, a while loop will keep…

For Loop in PHP

PHP for loop flowchart diagram

The for loop in PHP is an entry controlled loop structure that executes a block of code for a specific number of times based on the given conditions. It executes the code block as long as the condition evaluates to…