Connecting Tech Pros Worldwide Forums | Help | Site Map

Explain...

Sharif Tanvir Karim
Guest
 
Posts: n/a
#1: Jul 17 '05
Can someone please explain what this:

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

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

--
Sharif Tanvir Karim
http://www.onlyonxbox.net



Pedro
Guest
 
Posts: n/a
#2: Jul 17 '05

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.
J˙Giusł vs ::NRG::ius
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Explain...



"Sharif Tanvir Karim" <sharif@nyc.rr.com> ha scritto nel messaggio
news:PcGkb.7549$pT1.3518@twister.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


Closed Thread