如何使用 PHP jdmonthname() 函数获取完整的月份名称?
How to get the full month name using PHP jdmonthname() function?
我正在尝试使用 PHP 函数 jdmonthname()
从过去的日期获取月份名称。
这是我目前的代码:
<?php
$d=gregoriantojd(12,02,2010);
echo jdmonthname($d);
?>
有效,但 returns 数字格式的月份名称。我怎样才能得到月份的全名?
您需要包含第二个参数来指定 calendar/language。
<?php
$d=gregoriantojd(12,02,2010);
echo jdmonthname($d, 1);
?>
第一个问题是你有一个名为 $d 的变量并且你正在传递
$jd 到函数作为参数,第二个是 jdmonthname() 有两个参数......现在这是工作代码。
<?php
$jd =gregoriantojd(12,02,2010);
echo jdmonthname($jd,1);
?>
我正在尝试使用 PHP 函数 jdmonthname()
从过去的日期获取月份名称。
这是我目前的代码:
<?php
$d=gregoriantojd(12,02,2010);
echo jdmonthname($d);
?>
有效,但 returns 数字格式的月份名称。我怎样才能得到月份的全名?
您需要包含第二个参数来指定 calendar/language。
<?php
$d=gregoriantojd(12,02,2010);
echo jdmonthname($d, 1);
?>
第一个问题是你有一个名为 $d 的变量并且你正在传递 $jd 到函数作为参数,第二个是 jdmonthname() 有两个参数......现在这是工作代码。
<?php
$jd =gregoriantojd(12,02,2010);
echo jdmonthname($jd,1);
?>