Jump to content

Retrieving array elements using key-value pairs set by variables.


TwistedBalloon

Recommended Posts

Is there some way to do the following:

 

I want to pick one array from a group of arrays and then access a value within it. All the arrays have similar names:

$myarray1

$myarray2 etc.

 

What I thought would be simple would be to append the appropriate digit to the end as needed to

select the array I want to extract data from

$desiredarray = '$myarray'.1;

 

 

But when I echo out something like $desiredarray[0] I get a string, not the value of the array

element I was trying to address.

 

Anybody have any suggestions?

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.