Quote:
Originally Posted by Donny Bahama
Is there a better way of doing this? Something short and much more efficient? Seems like every time I do something like this, there's always a way to do it in just a line or two of code...
|
Yes, the general rule in
PHP is that if you find yourself repeating something common, there has to be an easier way. How about
- Code: Select all
<?php
$inval = "09";
$tsample = mktime(12,0,0,$inval,15,2007);
$mname = date("F",$tsample);
print ("It is the month of $mname");
?>
which uses the already-provided tables of month names within the date function ...