<?php
function calcul_timestamp($date)
{ 
	list($jour, $mois, $annee) = explode('-', $date);
	$timestamp = mktime (0, 0, 0, $mois, $jour, $annee);
	return($timestamp);
}
	 
function compter_jours($debut, $fin)
{
        //60 secondes X 60 minutes X 24 heures dans une journée
        $nbSecondes= 60*60*24;
 
        $debut_ts = strtotime($debut);
        $fin_ts = strtotime($fin);
        $diff = $fin_ts - $debut_ts;
        return round($diff / $nbSecondes);
}

function trouver_jour_semaine($date)
{
	$joursem = array('dim', 'lun', 'mar', 'mer', 'jeu', 'ven', 'sam');
	list($jour, $mois, $annee) = explode('-', $date);
	$timestamp = mktime (0, 0, 0, $mois, $jour, $annee);
	//echo $timestamp;
	return($joursem[date("w",$timestamp)]);
}

?>