<?php

$person1 = getBirthDate('03/11/1972');
//echo $person1[0] . " " . $person1[1];

/*$person2 = getBirthDate('02/08/1991');
echo $person2[0] . " " . $person2[1];*/
function getBirthDate($input){
	$x=explode("/",$input);
	$i=count($x);
	
	$years=(2012-($x[$i-1]));
	$days=$x[$i-2];
	$months=$x[$i-3];
	
	$totaldays = ($years * 365);
	
	if($months>=1){
		$totaldays+=31;
	}
	if($months>=2){
		$totaldays+=29;
	}
	if($months>=3){
		$totaldays+=31;
	}
	if($months>=4){
		$totaldays+=30;
	}
	if($months>=5){
		$totaldays+=31;
	}
	if($months>=6){
		$totaldays+=30;
	}
	if($months>=7){
		$totaldays+=31;
	}
	if($months>=8){
		$totaldays+=31;
	}
	if($months>=9){
		$totaldays+=30;
	}
	if($months>=10){
		$totaldays+=31;
	}
	if($months>=11){
		$totaldays+=30;
	}
	if($months>=12){
		$totaldays+=31;
	}
	$totaldays+=$days;
	$totalyears=intval($totaldays/365);
	$isbirthday = false;
	if($totaldays%365==0){
		$isbirthday=true;
	}
	
	echo $isbirthday . "\n";
	echo $totalyears;
	
	//$returnarray=array('age' => , 'birthday'=>$isbirthday);
}
?>