I was wondering how I could use PHP to calculate one's age given a date string with values from a JSON array:
{
"DOB":{ // should I use integers or strings for these values? I'm assuming strings for now.
"year": "1970",
"month": "01",
"day": "01"
}
}
How would I then use PHP to calculate the age?
Additionally, say all of this information is a small part of something like a staff directory, with the format of { "People":{ "user1":{ label: value },"user2":{ label: value} } }
. How could I use PHP to create <label>
tags for label within <li>
tags for value (<li><label>label</label>value</li>
) within unordered lists for each user within divs for each user?
Please tell me if this is confusing; and the calculation of the age is my highest priority right now.