In PHP have an alternative syntax for if, while, for, foreach, and switch. The basic form of the alternate syntax is to change the opening brace to a colon (:) and the closing brace to endif;, endwhile;, endfor;, endforeach;, or endswitch;, respectively.
for (initial; condition; increment) :
Program will execute if condition is true;
Output : 1 2 3 4 .