以下代码实现这样的功能:
比如数字01则返回January,数字02则返回February,依此类推。
代码如下:
<?php /** * 根据月份数字返回月份名称 * edit www.jb200.com * date 2013/6/21 */ function Month($NumMonth) { switch($NumMonth) { Case "01": return "January"; break; Case "02": return "February"; break; Case "03": return "March"; break; Case "04": return "April"; break; Case "05": return "May"; break; Case "06": return "June"; break; Case "07": return "July"; break; Case "08": return "August"; break; Case "09": return "September"; break; Case "10": return "October"; break; Case "11": return "November"; break; Case "12": return "December"; break; } } ?>