Skip to content

Instantly share code, notes, and snippets.

View bald-cat's full-sized avatar
🔋

Babaiev Ihor bald-cat

🔋
View GitHub Profile
@Padilo300
Padilo300 / PHP вычислить возраст по дате рождения.
Created January 29, 2018 14:14
PHP вычислить возраст по дате рождения.
function calculate_age($birthday) {
$birthday_timestamp = strtotime($birthday);
$age = date('Y') - date('Y', $birthday_timestamp);
if (date('md', $birthday_timestamp) > date('md')) {
$age--;
}
return $age;
}
//вызов функции