I'm sorry for this beginner question. My problem is that I would like to get the value of the variable name assigned in the array. For instance like this:
$fruits = array($apple, $mango, $banana);
And then I am assigning the elements in the array same values.
for ($i = 0; $i < count($fruits); $i++) {
$fruits[$i] = "fruit";
}
When I want to print the apple value in the array I would do:
echo $fruits[0];
But what I want is that to print the value of apple in the array using:
echo $apple;
How would I do this? Sorry beginner here..