The meaning of a while statement is simple. It tells PHP to execute the nested statement(s) repeatedly, as long as the while expression evaluates to TRUE. The value of the expression is checked each time at the beginning of the loop, so even if this value changes during the execution of the nested statement(s), execution will not stop until the end of the iteration (each time PHP runs the statements in the loop is one iteration). Sometimes, if the while expression evaluates to FALSE from the very beginning, the nested statement(s) won't even be run once. We can group multiple statements within the same while loop by surrounding a group of statements with curly braces.
Syntax:
Functionality: Workshop 6 program asks user to input a number. A JavaScript validation has been used to validate the numerical value. Then program prints Table using PHP while loop.

No comments:
Post a Comment