SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: what's the meaning of this code.

  1. #1
    SitePoint Evangelist runeveryday's Avatar
    Join Date
    Jul 2009
    Posts
    428
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    what's the meaning of this code.

    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'] ?

  2. #2
    From Italy with love bronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    8,604
    Mentioned
    76 Post(s)
    Tagged
    4 Thread(s)
    yes

  3. #3
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    perhaps you could do

    echo "<pre>";
    print_r($items['menufun']);
    echo "</pre>";

    to see the o/p

  4. #4
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it's created a 2 dimension array.. so:

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

  5. #5
    Unobtrusively zen silver trophybronze trophy
    SitePoint Award Recipient paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,203
    Mentioned
    40 Post(s)
    Tagged
    0 Thread(s)
    For further details, see the Arrays documentation. Example #7 demonstrates multi-dimensional associative arrays.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  6. #6
    SitePoint Evangelist runeveryday's Avatar
    Join Date
    Jul 2009
    Posts
    428
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    got it,many thanks to all you guys

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •