thanks. i am having trouble implementing it though. i have
PHP Code:
<?php
include("addressbook.php");
function cmp_date($a, $b) {
return strtotime($b['date_pilot']) - strtotime($a['date_pilot']) ;
}
usort($programs, 'cmp_date');
foreach ( $programs as $prog ) {
if ( $prog['genre'] == 'action-thriller' ) {
echo
'<dl><dt>',
$prog['prd_id'],
$prog['project'], ' ',
'genre: ', $prog['genre'],' ',
'pilot-date: ', $prog['date_pilot'],
'</dt><dd>',
$prog['description'],
'</dd></dl>';
}
}
?>
it seems to have no effect. i tried adding your function between the "if" and "echo" and other random things but they just give syntax errors... so i think i have it in the right place.... i research the usort function a bit and it all looks correct but it is not working for some reason.
Bookmarks