<?php class Burc{ function Hesapla($date){ $date=strtotime($date); $month=date("m",$date); $day=date("m",$date); $dat=getdate(mktime(2,0,0,$month,$day)); $dat=$dat["yday"]; $g=Array(13=>356,12=>326,11=>296,10=>266,9=>235,8=>203,7=>172,6=>140,5=>110,4=>78,3=>51,2=>20,1=>0); foreach ($g as $key=>$value) if ($dat>=$value) break; if ($key>12) $key=1; return $this->yazdir($key); } function yazdir($sira){ $burclar=["Yay","Oğlak","Kova","Balık","Koç","Boğa","İkizler","Yengeç","Aslan","Başak","Terazi","Akrep","Yay","Oğlak"]; return $burclar[($sira)]; } } $burc=new Burc(); echo $burc->Hesapla("10.05.2018"); echo "<br>"; echo $burc->Hesapla("06.06.1950"); echo "<br>"; ?>
Çıktı
Boğa İkizler