本文介绍了PHP 中的乘法函数结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我还是 PHP 初学者.我有一个小问题,我想将值 get_formatted_order_total();
乘以 3.75,我所做的是
I'm still beginner in PHP. I have a small problem, I would to multiply the value get_formatted_order_total();
with 3.75 and what I did is
get_formatted_order_total(); * 3.75
但是没有用.
这是代码
<li class="total">
<?php _e('Total:', 'woocommerce'); ?>
<strong><?php echo $order->get_formatted_order_total(); ?></strong>
</li>
谢谢
推荐答案
分号位于 指令结束.由于这是一条指令,您需要将分号移到行尾:
Semi-colons go at the end of an instruction. Since this is all one instruction, you need to move the semi-colon to the end of the line:
echo get_formatted_order_total() * 3.75;
示例:http://codepad.org/HH3RLZCR
这篇关于PHP 中的乘法函数结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!