LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-09-2002, 11:55 PM   #1
lhoff
Member
 
Registered: Jun 2001
Location: Chicago
Distribution: Mandrake 10.0 Official
Posts: 181

Rep: Reputation: 30
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!!
 
Old 06-10-2002, 03:49 PM   #2
lhoff
Member
 
Registered: Jun 2001
Location: Chicago
Distribution: Mandrake 10.0 Official
Posts: 181

Original Poster
Rep: Reputation: 30
Found solution: build arrays in reverse order.

Thanks anyway!...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to allocate memory for a multidimensional array ? indian Programming 12 11-19-2004 04:37 AM
return index of element in java multidimensional array dave bean Programming 8 11-28-2003 12:00 PM
PHP array help? HappyDude Programming 1 10-13-2003 07:48 PM
multidimensional array (php) niehls Programming 2 01-31-2003 06:34 AM
PHP to mySQL array problem mounters Programming 3 02-17-2002 05:20 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration