Jump to content

advice on age groups


runnerjp

Recommended Posts

just looking for some advice for this 1 as you will se it is rather complex lol

 

ok so at the moment i have it set up so age can be found from dob!

 

but now i would like to set it up so it finds out the agegroup that athlete is within

 

the current structure looks like this

SNR    23 +

 

U23 U23 and O20 on 31st December in competition year

 

U20 U20 and O17 on 31st December in competition year

 

U17 U17 and O15 on 31st August in competition year

 

U15 Aged 13 or 14 on 31st August at end of Competition year

 

 

thing is i can do it by age but also have to add the 31st dates to see if its changed... any advise lol

 

 

Link to comment
https://forums.phpfreaks.com/topic/108692-advice-on-age-groups/
Share on other sites

Well you can write one function to do it just have a place to set the variable for the age

 

function get_age($dob, $date)

 

now you can check either their age from now or in december

 

december

$age = get_age("1970-04-14", "2008-12-31");

 

today

$age = get_age("1970-04-14", date("Y-m-d"));

 

Ray

Link to comment
https://forums.phpfreaks.com/topic/108692-advice-on-age-groups/#findComment-557421
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.