The for loop are the most complex loops in PHP.The “for loop” is used when the developer has a clear idea about the number he wants to execute a block of code. The number of required iteration has to be known before writing the loop. This is also known as entry-controlled loops. They behave like their C counterparts. It has three main parts or parameters to code: the initialization part, the condition, and the increment or decrement part.
Basic Syntax of For Loop:
for (initialization; condition; increment)
{
code to be executed;
}