我正在尝试在html文件中进行除法计算,但它似乎无法使用php或脚本工作。 {{property.listprice}}在我的html文件中正确显示了一个数字,但其他项目不起作用。我不知道如何打电话......这就是我所拥有的。
<?php
$first_number = {{ property.listprice }};
$second_number = 2;
$sum_total = $second_number / $first_number;
print ($sum_total);
?>
该文件以propertyDetails.html结尾,这是插件的一部分,因此无法更改。没有函数{{property.listprice}}可以自行显示。我正在尝试编写一个基本上接受该数字的函数,然后将其除以2 ...
答案 0 :(得分:0)
有很多可能的原因导致它无法正常工作,我将从基础开始,并将采用典型的解决方案。
$first_number
并确保其中包含任何值。echo $sum_total
代替print
功能。