PHP Programs

Program for Associative Array

In this program we demonstrate use of the Associative Array, An  Associative array with a string index each value can be assigned a specific key.





/* First method to associate create array */






echo"salary of x is=".$salaries['x']."<br/>";

echo"salary of y is=".$salaries['y']."<br/>";

echo"salary of z is=".$salaries['z']."<br/>";

/* Second method to create array. */




echo"Salary of x is= ".$salaries['x']."<br/>";

echo"Salary of y is=".$salaries['y']."<br/>";

echo"Salary of z is =".$salaries['z']."<br/>";




When Run The Program Following Output:

salary of x is=200000

salary of y is=100000

salary of z is=50000

Salary of x is= high

Salary of y is=medium

Salary of z is =low


Releted Programs

© 2017 codewmAll rights reserved.