I am scraping Birthdays from a webpage that are in this format
September 15, 1987
$age = 15;
$page = source code of a html page;
so far i have made this function
How do i return the function as true if the date scaped makes the person over 15 and false if the person is younger?
PHP Code:
function checkForAge($page,$age) {
preg_match('|Born on ([a-zA-Z]*\s[0-9]*,\s[0-9]*)\\\u003c\\\/span>|', $page, $match);
if($match && count($match)>0) {
echo "Match Found";
$dateOfBirth = str_replace(",","",$match[1]);
// $dateOfBirth = date('d/m/Y', strtotime($dateOfBirth));
$dateOfBirth = strtotime($dateOfBirth);
/*
if("date of birth makes person over $age)
{
return true;
}
else
{
return false;
}
*/
}