If i have an array
$places = array('year' => '2012', 'place' => 'school');
Is there any way to do this in PHP
foreach ($places as $key => $value)
{
$key = $value
}
But so that the variables are set based on the key name.
For example, variables will be available this way.
echo $year;
2012
echo $place;
school
source
share