<?php $san= "" ; $year = 2013 ;
switch (($year - 7) % 12) {
case 0:$san = "rat" ; break ;
case 1:$san = "tiger" ; break ;
case 2:$san = "elephant" ; break ;
case 3:$san = "sneake" ; break ;
case 4:$san = "dog" ; break ;
case 5:$san = "cat" ; break ;
case 6:$san = "roar" ; break ;
case 7:$san = "keke" ; break ;
case 8:$san = "weiki" ; break ;
case 9:$san = "liki" ; break ;
case 10:$san = "ziki" ; break ;
case 11:$san = "hump" ; break ;
echo ucwords("The year {$year} is the year of {$san} <br/>") ;
break ;
default:
echo "the year {$year} not listed <br/>" ;
break;
}
Ali_77 0 Newbie Poster
Ali_77 0 Newbie Poster
rproffitt 2,662 "Nothing to see here." Moderator
diafol
rproffitt commented: I'll cue up "In the Year 2525" and hope the OP can support more years. +0
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.