Computers are great at crunching piles of data, and piles of data usually takes the form of sequences, streams, tables and so on. Such data sets usually need to be iterated over. At the very least, some statements may need to be executed more than once. Loops in C++ and iteration statements are used for this purpose.
Block of code executing until the conditions false is called as a loop.
PHP While loop can be of different categories like
PHP While loop is considered when it is unknown how many times to execute.
Compiler only checks the condition is true or false.The While loop executes the statement only when the expression becomes True. After the statement is executed, it will once again evaluate the expression and repeat as needed.