The while loop in PHP is a type of loop that can be used to repeat a block of PHP code until the loop exit the execution when it return false by the condition. The case of use for this loop type that when the iteration has unknown number and you set a condition inside

do while

The PHP do while loop is another pattern for PHP loop, it works like in the PHP while loop but here, it executes one loop before the condition then check the condition if it has a true value it will repeat the do block again otherwise, it will exit the loop. The basic pattern of


The PHP foreach is another pattern for PHP loops to iterate and expose the data of the iterable expression though the loop. The foreach can also display the element keys during the loop. The syntax of PHP foreach would be written like the below code. Also there is another pattern for the PHP foreach. In


Th PHP continue statement is an expression used to ignore or skip the current code block and move to the next loop. It can be written by this word “continue“. This expression not exit the loop it only restart the loop for the following field according to the iteration index. The expression appears and works


The PHP break used to log out or ending the PHP loop immediately, this expression can be used in for loop, foreach, while, do while and switch. The expression of loop break would be like the following code. The PHP break accepts a numerical arguments which allow the nested loop to exit it directly. Let’s

PHP Loops

The PHP loop is a repetition for a collection or a compound of data to expose the contents. And that can be done using PHP loops such as foreach, while loop, for loop, let’s see examples. The PHP loop works according to some sequence, let’s see how it does work. How the PHP Loop Works


PHP function is a block contains a piece of code which can work in many places in your program. The functions in PHP can take parameters to change the returned result according to the dynamic code inside. When you call PHP function in many places, it takes a different input values every time and that

Named Arguments

The PHP named arguments are the names of the arguments through passing the values, which allow you to add a name for the argument beside the value and that can be separated with the double dots. Let’s see an example. So, you don’t need to fill the function arguments by order. Anyway, this feature is

Parameters and Arguments

The PHP function parameters are data or variables that can be passed through the function. In the other hand, the PHP function arguments are the values that can be assigned when call the function. Before getting started, you have to understand the difference between parameters and arguments. The Difference between the Arguments and the Parameters

Arrow Functions

The first appearance of PHP arrow functions were in PHP version 7.4, the arrow function can access all variables in the same scope, so you don’t need to define an argument as in PHP anonymous functions. And you don’t need to pass it as a reference or with a global word. The PHP functions are