Forum : array assignment
Brief description  about Online courses   join in Online courses
View SARITA  DUBEY 's Profile

array assignment

Create an Associative array that stores employee’s name, their salary and stores their designation in a company. Print this information.

What to do in this assignment.. i'm not able to create three fields.

Please help me..

Thank you
Asked by SARITA DUBEY | Jul 21, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi sarita,

<?php


$employees["employee 1"]["name"] = "saritha";
$employees["employee 1"]["job"] = "CEO";
$employees["employee 1"]["salary"] = "80,000";

$employees["employee 2"]["name"] = "Anitha";
$employees["employee 2"]["job"] = "Manager";
$employees["employee 2"]["salary"] = "35,000";

$employees["employee 3"]["name"] = "Vanitha";
$employees["employee 3"]["job"] = "Cashier";
$employees["employee 3"]["salary"] = "15,000";



?>

Do go through the above code, you will have a better understanding of arrays. Later loop it and display the values.

Thanks
Jul 23, 2010