Wow... that was confusing....
That works fine for what I am doing except for the date time as I have to process them with mktime and I am just confused on how to get the array to mktime and then back to the array that I can insert into the Db.
I'd say you can work with it in the array before you implode it into a string.
$arr = array(
'season'=>'fall',
'year' => '2006',
'games' => array(
0 => array( 'date' =>'August 1, 2006', 'time'=>'1:30 pm', 'place'=>'home', 'opponent'=>'team2'),
1 => array( 'date' =>'August 8, 2006', 'time'=>'3:30 pm', 'place'=>'away', 'opponent'=>'team4')
)
);
Given that array, just do something like:
<?php
// Given $arr....
foreach($arr['games'] as $id=>$game)
{
// Each $game is now an array....
$new = array('datetime'=>'', 'place'=>$game['place'], 'opponent'=>$game['opponent']);
$datetime = strtotime($game['date'].' '.$game['time']);
$new['datetime'] = $datetime;
$arr['games'][$id] = $new;
}
var_dump($arr);
?>
Seems to get you what you want (or something like it):
array(3) {
["season"]=>
string(4) "fall"
["year"]=>
string(4) "2006"
["games"]=>
array(2) {
[0]=>
array(3) {
["datetime"]=>
int(1154453400)
["place"]=>
string(4) "home"
["opponent"]=>
string(5) "team2"
}
[1]=>
array(3) {
["datetime"]=>
int(1155065400)
["place"]=>
string(4) "away"
["opponent"]=>
string(5) "team4"
}
}
}