Jason Pruim wrote:
here is the print_r($_POST);
Array ( [tasks] => Array ( [31] => Array ( [txtReschedule] => 07/07/08
[chkDone] => 31 ) [39] => Array ( [txtReschedule] => 07/08/08 [chkDone]
=> 39 ) [34] => Array ( [txtReschedule] => 07/09/09 [chkDone] => 34 )
[36] => Array ( [txtReschedule] => ) [35] => Array ( [txtReschedule] =>
) [32] => Array ( [txtReschedule] => ) [33] => Array ( [txtReschedule]
=> ) [37] => Array ( [txtReschedule] => ) [38] => Array (
[txtReschedule] => ) ) )
ok, then from this, I assume that you are checking to make sure that [chkDone] is set when you loop
through the data. something like this should do the trick
<pre><?php
$tasks = array (
31 => array( 'txtReschedule' => '07/07/08', 'chkDone' => 31 ) ,
39 => array( 'txtReschedule' => '07/08/08', 'chkDone' => 39 ) ,
34 => array( 'txtReschedule' => '07/09/09', 'chkDone' => 34 ) ,
36 => array( 'txtReschedule' => '' ),
35 => array( 'txtReschedule' => '' ),
32 => array( 'txtReschedule' => '' ),
33 => array( 'txtReschedule' => '' ),
37 => array( 'txtReschedule' => '' ),
38 => array( 'txtReschedule' => '' ),
);
# replace $tasks with $_POST['tasks'] to check your actual data
foreach ( $tasks AS $id => $data ) {
if ( !isset($data['chkDone']) ) {
continue;
}
list($month,$day,$year) = explode('/', $data['txtReschedule']);
$utime = mktime(0,0,0,(int)$month,(int)$day,(int)'20'.$year);
echo date('c', $utime)."\n";
}
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php