EVALUATION Chapter Loops in PHP version CHAPTER version CHAPTER - - - - Chapter Loops in PHP . What are the three parts of the for loop syntax in PHP? a) initialization, condition, increment b) initialization, code block, condition c) code block, condition, increment d) condition, initialization, code block . When is the ‘initialization’ part of a for loop executed?
a) Before each iteration b) After each iteration c) Only once at the beginning of the loop d) Only once at the end of the loop . What is the purpose of the ‘increment’ part of a for loop? a) To initialize variables b) To update variables c) To check the condition d) To execute the code block . What type of loop is “while loop” in PHP?
a) Entry-Check Loop b) Exit-Check Loop c) Counter Loop d) Iteration Loop . What type of loop is “do...while loop” in PHP? a) Entry-Check Loop b) Exit-Check Loop c) Counter Loop d) Iteration Loop . Which looping structure should be used to iterate over elements of an array in PHP?
a) for loop b) while loop c) do...while loop d) foreach loop . What is the output of the following code? $array = array( , , , , ); foreach ($array as $value) { echo $value; } a) b) c) d) None of the above Chapter Loops in PHP version CHAPTER version CHAPTER - - - - Chapter Loops in PHP Part II ( Marks) Short Answers . What is the purpose of a loop in PHP?
. Write the syntax for an ‘for’ loop in PHP. . Write the syntax for ‘while’ loop in PHP.
. How is the ‘condition’ in a while loop evaluated? . What is the output of the following code snippet?
$i = ; while ($i <= ) { echo $i . “<br>”; $i++; } Part III ( Marks) Explain in Brief Answer . Describe the three parts of a for loop in PHP (initialization, condition and increment) and explain their purpose. .
Write a PHP code to print to numbers in ascending order using for loop . . Explain the difference between while loop and do … while loop in PHP. Part IV ( Marks) Explain in detail .
Explain ‘ for ’ loop with example. . Write a PHP code to print to numbers in ascending order using while loop and do… while loop . .
Explain ‘ foreach ’ loop with examples. student activity z Create simple array element and display the values using foreach z Explain real world usages in using Looping Structure Chapter Loops in PHP version CHAPTER version CHAPTER - - - - Basic HTML Form Controls The following control are available in HTML forms: Text inputs Buttons Checkbox Radio box File Select Form Tag Text inputs contain textbox and text area controls. Buttons may contain Submit button, Reset button and Cancel Button. Checkbox is a important feature which