This is a re-post of a previous topic. However I'm simplifying it to hopefully get a response this time.
Given the following variables:
$id = "home";
$home=array("4.8","2.3");
I want to combine these variables to print the first number in the array.
This doesn't work:
echo "$[$id][0]";
Should print the number 4.8. The variable "id" is dynamic and can be a variety of names in a given while loop. That is why it isn't as simple as calling the array itself. Really what I want to know is how the syntax in php works for defining variables with variables. Any ideas?
thanks in advance,
Dave