English

Explain the use of for each loop in PHP.

Advertisements

Question

Explain the use of for each loop in PHP.

Short/Brief Note
Advertisements

Solution

  1. The foreach loop works only on arrays,
  2. It is used to loop through each key/value pair in an array.
shaalaa.com
Looping Structure
  Is there an error in this question or solution?
Chapter 7: Looping Structure - Evaluation - PART – II [Page 118]
Advertisements
Share
Notifications



      Forgot password?
Use app×