LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP: Multidimensional array problem (https://www.linuxquestions.org/questions/programming-9/php-multidimensional-array-problem-23024/)

lhoff 06-09-2002 10:55 PM

PHP: Multidimensional array problem
 
Long time beating head against wall. Hope it will feel good soon....

I have the following arrays (I'm a beginner):


//Categories
$cat['venue']=$venue;
$cat['contacts']=$contacts;
$cat['room']=$room;
$cat['ceiling']=$ceiling;
$cat['freight']=$freight;
$cat['equipment']=$equipment;
$cat['lighting']=$lighting;
$cat['electrical']=$electrical;
$cat['AV']=$AV;
//Screens
$ceiling['ceiling-data2.php']=$ceiling2;
$ceiling['ceiling-data3.php']=$ceiling3;
$ceiling['ceiling-data4.php']=$ceiling4;
$ceiling['ceiling-data5.php']=$ceiling5;
$ceiling['ceiling-data6.php']=$ceiling6;
$ceiling['ceiling-data7.php']=$ceiling7;
//Screen fields
$ceiling2[0]='roomID';
$ceiling2[1]='description';
$ceiling2[2]='sofitNotes';


But, when I run the following script (trying to get 'description' as my returned result), I get nothing:


$result = $cat['ceiling']['ceiling-data2.php'][1];
echo $result;


I've tried a host of other ways to write the $result variable -- many of them return parse errors, some return nothing. Can anyone help?

THANKS!!

lhoff 06-10-2002 02:49 PM

Found solution: build arrays in reverse order.

Thanks anyway!...


All times are GMT -5. The time now is 06:46 PM.