Explain...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sharif Tanvir Karim

    #1

    Explain...

    Can someone please explain what this:

    $variable = $variable2['xxx']['xx']

    is? I mean is that putting two arrays together or what?

    --
    Sharif Tanvir Karim



  • Pedro

    #2
    Re: Explain...

    Sharif Tanvir Karim wrote:[color=blue]
    > Can someone please explain what this:
    >
    > $variable = $variable2['xxx']['xx']
    >
    > is? I mean is that putting two arrays together or what?[/color]

    No, not really ...

    $variable2 is an array of arrays; each element of it is an array --
    mostly like an HTML table: each row in the table is a set of cells.

    You can have something like:

    <?php
    $table = array();
    $table['row1'] = array(); // not needed, just put it to make it easier
    // to see this is an array :)
    $table['row1']['cell1'] = 'top left';
    $table['row1']['cell2'] = 'top center';
    $table['row1']['cell3'] = 'top right';
    $table['row2'] = array(); // not needed
    $table['row2']['cell1'] = 'middle left';
    // etc...

    // and, of course, you can assign any of these values to a variable
    $x = $table['row3']['cell3'];
    // if logic doesn't fail me $x should have 'bottom right'
    ?>



    HTH

    --
    I have a spam filter working.
    To mail me include "urkxvq" (with or without the quotes)
    in the subject line, or your mail will be ruthlessly discarded.

    Comment

    • JÿGius³ vs ::NRG::ius

      #3
      Re: Explain...


      "Sharif Tanvir Karim" <sharif@nyc.rr. com> ha scritto nel messaggio
      news:PcGkb.7549 $pT1.3518@twist er.nyc.rr.com.. .[color=blue]
      > Can someone please explain what this:
      >
      > $variable = $variable2['xxx']['xx']
      >
      > is? I mean is that putting two arrays together or what?[/color]


      you should try with some good PHP tutorial.

      Bye.

      Gius


      Comment

      Working...