ok i need to create dynamic variable names like so:
$names = array("cat","dog","mouse");
foreach($names as $name_values)
{
$$name_values = "I'm the variable for $name_values";
}
echo $cat;
would give "I'm the variable for cat"
thats ok but i want to be able to access the created variables later on by looking at the $names array.
how do i make a script that will know that there is a variable called $cat because there is a "cat" string in the array
I can't go echo $cat; because i don't know what will be in the array, i can't go echo $$name_values; because that would give me the value for $mouse as "mouse" was the last string in the foreach().
Any ideas?