Tag: loop-in-php

Loops in PHP
384
2020-10-05 16:01:19

Loops in PHP are used to execute the same block of code a specified number of times. PHP supports the following 4 types of loops: For Loop - Loops through a block of code a specified number of times. While Loop - Loops through a block of code if and for as long as a condition has been specified true. Do ... while loop - Loops through a block of code once, and then repeats that loop as long as a given condition becomes true. Foreach loop - Loops through a block of code for each element in an array.

Read more