I am a PHP beginner. I want to create multiple variables and the name of those variables should have a value appended to it which depends on a counter variable of a for loop.
foreach ( $xmlTagNames as $xmlKey => $xmlTagName )
{
if ($xmlTagName == "property")
{
for($i = 0; $i < 4; $i ++)
{
$$xmlTagName = $xmlFile->createElement ( $xmlTagName );
}
}
}
At the seventh line I want the variable names like $property0,$property1 etc. How could this be done?