Tuesday, July 3, 2012

associative arrays in php

Associative arrays are similar to arrays discussed previously, however they have a key attached to a value.

As an example

$food = ('pizza' => 300 , 'pasta' => 100, 'ice cream' =>100 );


to get the value stored at key 'pizza' :-


$food['pizza'];

No comments:

Post a Comment