मराठी
तामिळनाडू बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान इयत्ता १२

Discuss in detail about Foreach loop. - Computer Applications

Advertisements
Advertisements

प्रश्न

Discuss in detail about Foreach loop.

थोडक्यात उत्तर

उत्तर

  • The foreach statement is used to loop through arrays.
  • For each pass the value of the current array element is assigned to $value and the array pointer is moved by one and in the next pass next element will be processed.

    Foreach loop Structure and Flow
  • Syntax:
    foreach ($array as $value) {
    code to be executed;
    }
  • Example:

    <?php
    $Student_name = a rrayÇ’MagiIan’ “Iniyan’
    “NiIani’ “Sibi’ “Shini”);
    foreach ($Student_name as $value) {
    echo “$value <br>”;
    }
    ?>
shaalaa.com
Looping Structure
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 7: Looping Structure - Evaluation - PART – IV [पृष्ठ ११८]

APPEARS IN

सामाचीर कलवी Computer Applications [English] Class 12 TN Board
पाठ 7 Looping Structure
Evaluation - PART – IV | Q 2. | पृष्ठ ११८
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×