I have an array :
$days = array(
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday'
);
And I have a query witch is getting me the days from the database (day_name,ID); For what I need your help: I want to fill the array with the loop below and make it associative. Example result :
thursday => array(
'ID' => 1,
'name' => thursday
),
friday => array(
'ID' => 1,
'name' => thursday
),
....eg
My code now:
$query='Query days from database';
foreach($query as $res)
{
foreach($days as $day)
{
if($res == $day)
{
// now there I want to put informations
}
}
}