Log 2317
12/12/2023 2023-12-12 12:24// Get the current date
$currentDate = date(“d/m/Y”);
// Get the given date of birth from the placeholder
$birthDate = #תאריך לידה#;
// Convert both dates to timestamps
$currentTimestamp = strtotime($currentDate);
$birthTimestamp = strtotime($birthDate);
// Calculate the difference in seconds between the two timestamps
$timeDiff = $currentTimestamp – $birthTimestamp;
// Convert seconds to years by dividing by the number of seconds in a year (365.25 days)
$age = floor($timeDiff / (60 * 60 * 24 * 365.25));
// Echo the calculated age
return “גיל: ” . $age;