2 Control Structures And Loops

Web Technology II · Unit 2

Control Structures and Loops

Exam-focused notes for Control Structures and Loops (Web Technology II, BIT301): what the TU syllabus asks and how it has actually been tested, with 1 solved past questions from this unit.

What this unit covers

  • Conditional statements and switch statements
  • For loops and iteration
  • Foreach loops and array iteration
  • While and do while loops
  • Break and continue statements
  • Loop control flow

For loops and iteration

010 marks

What are casting operators? Differentiate for from foreach statement. Write PHP program to illustrate use of for and foreach.[10]

--- Casting operators are used to explicitly convert a value from one data type to another. In PHP, casting is done by placing the target type in parentheses before the variable or value. Cast Operator Description ------ (int) or (integer) Converts to integ...

Full solved answer →