我们想要制作日期whmcs7 格里高利日期从贾拉利变化 这就是为什么我们将以下代码放在文件tpl smarty
中{$invoice.datecreated}
{php}
include_once ($_SERVER["DOCUMENT_ROOT"] ."/templates/six/jdf.php");
$date = '{$invoice.datecreated}';
list($g_y, $g_m, $g_d) = explode("/", $date);
$str="/";
print "(".gregorian_to_jalali ($g_y, $g_m, $g_d,$str).")";
{/php}
但这段代码不是放在变量上 插入字符串
$date = '{$invoice.datecreated}';
print $date; // result: invoice.datecreated Instead 2015/01/31
请指导我
答案 0 :(得分:1)
我认为你需要双引号。
$date = "{$invoice.datecreated}"; //double quotes here as "
print $date;
示例:
$name = "My name";
echo '{$name}';//outputs {$name}
echo "{$name}";//outputs My name