Translating month number into month name Time is very important from times immemorial. Doing great things and making it happen in less time is more important as it can mean less effort. So I really like to know which way is faster and more efficient in the following codes, and I would happy to know any other way we can achieve the same code: 

$month=date('m');
//Using If..else
 if($month==1){
    echo "January";
}elseif($month==2){
    echo "February";
}elseif($month==3){
    echo "March";
}elseif($month==4){
    echo "April";
}elseif($month==5){
    echo "May";
}elseif($month==6){
    echo "June";
}elseif($month==7){
    echo "July";
}elseif($month==8){
    echo "August";
}elseif($month==9){
    echo "September";
}elseif($month==10){
    echo "October";
}elseif($month==11){
    echo "November";
}else{
    echo "December";
}




//Using Switch
switch($month){
case 1:
    echo "January";
break;
case 2:
    echo "February";
break;
case 3:
    echo "March";
break;
case 4:
    echo "April";
break;
case 5:
    echo "May";
break;
case 6:
    echo "June";
break;
case 7:
    echo "July";
break;
case 8:
    echo "August";
break;
case 9:
    echo "September";
break;
case 10:
    echo "October";
break;
case 11:
    echo "November";
break;
default:
    echo "December";
break;
}




//Using Array
$month_s=array(1=&gt;"January",2=&gt;"February",3=&gt;"March",4=&gt;"April",5=&gt;"May",6=&gt;"June",
7=&gt;"July",8=&gt;"August",9=&gt;"September",10=&gt;"October",11=&gt;"November",12=&gt;"December");
echo isset($month_s[$month]) ? $month_s[$month] : '';
Like I said in my comment: If you want to know which is faster, write a benchmarking script, it's that easy:

$start = microtime(true);
//if-hell approach
$ifs = microtime(true) - $start;
$start = microtime(true);
//switch
$switch = microtime(true) - $start;
$start = microtime(true);
//array
$array = microtime(true) - $start;


Then compare and echo the results in any way you like.
My gut tells me that in this case, the switch will probably be the faster option. Considering a switch construction is sort of like labeling blocks of code, and then do some sort of eval-go-to thingy.
Branching (if) is faster in terms of compilation, perhaps, but for the month of december, you'll end up performing all if statements.
The array approach, for this example, doesn't look like the fastest approach you can take in this case, because it's constructing an array, performing a HashTable lookup, evaluate the result of that lookup, then perform the same lookup again, or return an empty string. HashTable lookups are as fast as it gets, of course, but still, you're having to do 2 of them, just after you've constructed the HashTable. The other approaches don't construct to then perform a lookup.

Mind you, This is micro-optimization of the worst kind. It's completely pointless and the speed difference won't be noticeable. Especially if you use some form of OP-Code caching (APC, for example). That should be the first port of call if you're trying to optimize some code.

What code should you use?:
This is the better question to ask. The efficiency of some snippet of code isn't just determined by the time it takes to execute. Efficient code is good code (is stable, performant, error and notice-free) and is easy to read, update and maintain.
If your determining the name of the month then it's pretty obvious the data-set is limited to 12 valid strings. But in most cases, you might end up with an ever growing switch or if-elseif-else tree. That's not efficient coding. The moment you have to scroll to see a single block of code, you can safely say it's time to think about refactoring your code.

That's why I'd either use the array approach (works just as well when data is coming from a query, so you can create a function that you can reuse). Or, if you are working on dates, I'd give way to normalization, and use the DateTime class. when I see new DateTime or $d = DateTime::createFromFormat, I know what to exepct. Even more so when I see:

[public] function doStuff(DateTime $date)
{
}