What's the meaning of this code


$items['menufun'] = array(
'title' => 'Greeting',
'page callback' => 'menufun_hello',
'access callback' => TRUE,
);

i haven’t seen this ever, only as i know, there always assign an array to a variable. but on the above its $items[‘menufun’] . an associative arrary? am i right, does it want to assign an array to the associative arrary variable $items[‘menufun’] ?

yes

perhaps you could do

echo “<pre>”;
print_r($items[‘menufun’]);
echo “</pre>”;

to see the o/p

I think it’s created a 2 dimension array… so:

 echo $items['menufun']['title'];
// returns 'Greetings'

For further details, see the Arrays documentation. Example #7 demonstrates multi-dimensional associative arrays.

got it,many thanks to all you guys