Saturday, 7 July 2018

Associate Array in PHP

<?php
$students = array();
$students[0] = array(
            'name' => 'Rahul',
            'course' => 'Dimplma in IT',
            'email' => "rahul@zixana.com"
            );

$students[1] = array(
            'name' => 'Priya',
            'course' => 'Dimplma in IT',
            'email' => "priya@zixana.com"
            );

foreach ($students as $key => $value) {
    echo $value['name'].' is enroled in '. $value['course'].' and has email id is '. $value['email'].'.';
    echo "<br>";
}

No comments:

Post a Comment