note 69501 deleted from function.date by colder

From: Date: Thu, 07 Sep 2006 23:39:40 +0000
Subject: note 69501 deleted from function.date by colder
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-116884@lists.php.net to get a copy of this message
Note Submitter: diosdelviento at gmail dot com Reason: bad code ---- // fecha en formato dd/mm/yyyy retorna la diferencia en dias function restarFechaSp($dFecIni, $dFecFin){ $dFecIni = str_replace("-","",$dFecIni); $dFecIni = str_replace("/","",$dFecIni); $dFecFin = str_replace("-","",$dFecFin); $dFecFin = str_replace("/","",$dFecFin); ereg( "([0-9]{1,2})([0-9]{1,2})([0-9]{2,4})", $dFecIni, $aFecIni); ereg( "([0-9]{1,2})([0-9]{1,2})([0-9]{2,4})", $dFecFin, $aFecFin); $date1 = mktime(0,0,0,$aFecIni[2], $aFecIni[1], $aFecIni[3]); $date2 = mktime(0,0,0,$aFecFin[2], $aFecFin[1], $aFecFin[3]); return round(($date2 - $date1) / (60 * 60 * 24)); }

« previous php.notes (#116884) next »