Mit diesem Einzeiler lässt sich schnell das aktuelle Alter anhand eines gegebenen Datums bestimmen:
1 2 3 4 |
function age ($birthday) { return floor((date("Ymd") - date("Ymd", strtotime($birthday))) / 10000); } |
Mit diesem Einzeiler lässt sich schnell das aktuelle Alter anhand eines gegebenen Datums bestimmen:
1 2 3 4 |
function age ($birthday) { return floor((date("Ymd") - date("Ymd", strtotime($birthday))) / 10000); } |