Re: Another simple question (Probably)
| From: | Jim Lucas | Date: | Tue, 10 Jul 2007 15:56:55 +0000 |
| Subject: | Re: Another simple question (Probably) | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258558@lists.php.net to get a copy of this message | ||
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