note 65151 added to function.date
| From: | gastonrodri at gmail dot com | Date: | Tue, 25 Apr 2006 16:15:18 +0000 |
| Subject: | note 65151 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-109657@lists.php.net to get a copy of this message | ||
other function to get the age,
function getAge($nacimiento)
{
$anionac =$nacimiento[0];
$mesnac =$nacimiento[1];
$dianac =$nacimiento[2];
$fecha_actual = date("Y-m-d");
$fecha_actual = explode("-",$fecha_actual);
$anio_act = $fecha_actual[0];
$mes_act = $fecha_actual[1];
$dia_act = $fecha_actual[2];
$edad = $anio_act - $anionac;
$comp_actual = $mes_act*1000 + $dia_act;
$comp_nac = $mesnac*1000 + $dianac;
($comp_actual < $comp_nac) ? $edad-- : "";
return $edad;
}
----
Server IP: 201.216.232.3
Probable Submitter: 200.63.17.2 (proxied: 10.0.0.211)
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/note/edit/65151
Del: integrated -- http://master.php.net/note/delete/65151/integrated
Del: useless -- http://master.php.net/note/delete/65151/useless
Del: bad code -- http://master.php.net/note/delete/65151/bad+code
Del: spam -- http://master.php.net/note/delete/65151/spam
Del: non-english -- http://master.php.net/note/delete/65151/non-english
Del: in docs -- http://master.php.net/note/delete/65151/in+docs
Del: other reasons-- http://master.php.net/note/delete/65151
Reject -- http://master.php.net/note/reject/65151
Search -- http://master.php.net/manage/user-notes.php