Creating a new variable
Posted: Wed Nov 07, 2007 4:27 am
Hi,
How would one assign values to a dynamically created variable?
Normally one would declare a variable before it is used. However, if you have a foreach loop can you create a variable for each value found in an array
i.e.
How would one assign values to a dynamically created variable?
Normally one would declare a variable before it is used. However, if you have a foreach loop can you create a variable for each value found in an array
i.e.
Code: Select all
foreach($arrArray as $varValue)
{
if(array_search("someValue", $otherArrayToSearch)===true) create new variable here from $varValue;
}