Jump to content

Is this possible?


antmeeks

Recommended Posts

Sorry, I guess I wasn't clear...

 

I'm not trying to make a multidimensional array out of 3 other arrays, I'm trying to consolidate the compounding of multiple array key values into one variable.

 

Literal from my example:

 

variable '$b' = the value of array1's key that equals whatever is assigned to '$a':

$b=$Array1[$a]

 

variable '$c' = the value of array2's key named the value of variable '$b':

$c=$Array2[$b]

 

variable '$d' = the value of array3's key named the value of variable '$c':

$d=$Array3[$c]

 

So... is it possible to build up the value of var $d with one statement instead of 3?

Link to comment
https://forums.phpfreaks.com/topic/264146-is-this-possible/#findComment-1353660
Share on other sites

Doh! I just figured that out right before your post....

 

You know it's getting late when you post in a forum before even trying it out first...

 

What I wanted to do was nest the arrays into one var - which, as you say, my original post was a completely valid example of:

 

$d=$Array3[$Array2[$Array1[$a]]];

 

:-[ Time for bed.

 

 

Link to comment
https://forums.phpfreaks.com/topic/264146-is-this-possible/#findComment-1353664
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.