Skip to content

Instantly share code, notes, and snippets.

@nguyenvanduocit
Created May 27, 2013 20:48
Show Gist options
  • Save nguyenvanduocit/5659004 to your computer and use it in GitHub Desktop.
Save nguyenvanduocit/5659004 to your computer and use it in GitHub Desktop.
Tính cung hoàng đạo
function getsign($date = null){
if($date == null)
return "NA";
list($month,$day,$year)=explode("/",$date);
if(($month==1 && $day>20)||($month==2 && $day<20)){
return "Aquarius";
}else if(($month==2 && $day>18 )||($month==3 && $day<21)){
return "Pisces";
}else if(($month==3 && $day>20)||($month==4 && $day<21)){
return "Aries";
}else if(($month==4 && $day>20)||($month==5 && $day<22)){
return "Taurus";
}else if(($month==5 && $day>21)||($month==6 && $day<22)){
return "Gemini";
}else if(($month==6 && $day>21)||($month==7 && $day<24)){
return "Cancer";
}else if(($month==7 && $day>23)||($month==8 && $day<24)){
return "Leo";
}else if(($month==8 && $day>23)||($month==9 && $day<24)){
return "Virgo";
}else if(($month==9 && $day>23)||($month==10 && $day<24)){
return "Libra";
}else if(($month==10 && $day>23)||($month==11 && $day<23)){
return "Scorpio";
}else if(($month==11 && $day>22)||($month==12 && $day<23)){
return "Sagittarius";
}else if(($month==12 && $day>22)||($month==1 && $day<21)){
return "Capricorn";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment