PHP for loop can be used to traverse set of code for the specified number of times. It should be used if number of iteration is known otherwise use while loop. Syntax Flowchart Example Output: We can use for loop inside for loop in PHP, it is known as nested for loop.
PHP while loop can be used to traverse set of code like for loop. It should be used if number of iteration is not known. Syntax Alternative Syntax Flowchart Example Output: Alternative Example Output: We can use while loop inside another while loop in PHP, it is known as nested while loop.
The PHP PEAR also known as PHP Extension and Application Repository, is a repository built especially for PHP software code. In this tutorial, you will learn how to install the PHP PEAR on the linux server. Install PEAR allows you to install various extensions without compiling the source packages.