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

Explain Indexed array and Associate array in PHP.

Advertisements
Advertisements

प्रश्न

Explain Indexed array and Associate array in PHP.

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

उत्तर

  • Indexed Arrays:
    Arrays with a numeric index for the available values in array variable which contains key-value pair as user/developer can take the values using keys.
    Example:
    <?php
    $teacher_name=array(“Iniyan”, “Kavin”, “Nilani”);
    echo “The students name are “ . $teacher_name[0]. “, “ . $$teacher_name[l]. “ and” . $teacher_name[2].
    ?>
  • Associative Arrays:

  1. Associative arrays are a key-value pair data structure.
  2. nstead of having storing data in a, linear array, with associative arrays you can store your data.
    Example:
    <?php
    $Marks=array(“Student1”=>“35”,“Student2”==>“17”,“Student3”=>“43”);
    echo “Student1 mark is” . $Marks[‘Student1’]. “ is eligible for qualification”;
    echo “Student2 mark is” . $Marks[‘Student2’]. “ is not eligible for qualification”;
    ?>
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 5: PHP Function and Array - Evaluation - PART – IV [पृष्ठ १०४]

APPEARS IN

सामाचीर कलवी Computer Applications [English] Class 12 TN Board
पाठ 5 PHP Function and Array
Evaluation - PART – IV | Q 5. | पृष्ठ १०४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×