ok here is the right one working : smt was wrong with the arrays i beleive :
<?php
// =====================================================
// This function returns the difference between a dates
// and the current date.
// arg1: separator
// arg2: startdate date dd mm yyyy
// return number of days of differences
// ======================================================
function diff_date( $sep, $startdate ){
// Date of file in database
$startdate = explode( "$sep", $startdate );
$startdate = mktime( 0, 0, 0, $startdate[1], $startdate[0],
$startdate[2] );
// Now
$enddate = mktime( 0, 0, 0, date("n"), date("d"), date("Y") );
// get difference in days by dividing by 24*60*60
return ( $enddate - $startdate ) / ( 86400 );
} // end function
echo diff_date("/", "05/3/2001") ;
?>
this one works :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]