<?
function burcbul($tarih){
$burclar=array();
$burclar["balik"]=mktime(0,0,0,1,21,1970);
$burclar["kova"]=mktime(0,0,0,2,20,1970);
$burclar["koc"]=mktime(0,0,0,3,21,1970);
$burclar["boga"]=mktime(0,0,0,4,21,1970);
$burclar["ikizler"]=mktime(0,0,0,5,22,1970);
$burclar["yengec"]=mktime(0,0,0,6,22,1970);
$burclar["aslan"]=mktime(0,0,0,7,24,1970);
$burclar["basak"]=mktime(0,0,0,8,24,1970);
$burclar["terazi"]=mktime(0,0,0,9,24,1970);
$burclar["akrep"]=mktime(0,0,0,10,24,1970);
$burclar["yay"]=mktime(0,0,0,11,22,1970);
$burclar["oglak"]=mktime(0,0,0,12,23,1970);
$gtarih=explode("-",$tarih);
$tarih=mktime(0,0,0,$gtarih[1],$gtarih[0],1970);
$selected_burc=$burclar["oglak"];
$c=0;
foreach($burclar as $burcadi=>$burc_tarih) {
if($tarih < $burc_tarih || $tarih == $burc_tarih) {
$selected_burc=$prevburc;
break;
}
$prevburc=$burcadi;
$c++;
}
return $selected_burc;
}
?>
//KULLANIMI
$gun=4;
$ay=11;
echo "Gün : $gun ";
echo "Ay : $ay ";
echo "Burcunuz : ".burcbul("$gun-$ay")."";
?>
|