The for loop The for loop is used to execute a set of statements for a certain number of times. Syntax: for (init; condition; increment/decrement) { code to be executed; } Components of for loop: init: set a counter variable…
Tag: loop
PHP Tutorial – do while loop
The do while loop In do while loop the statements or conditions are executed first then that condition is evaluated, the loop will continue while the condition is true. Syntax: do { code to be executed; } while (condition); Example:…