Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/274.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP如果需要其他帮助_Php_If Statement - Fatal编程技术网

PHP如果需要其他帮助

PHP如果需要其他帮助,php,if-statement,Php,If Statement,我已经疯了,我读了所有我能找到的东西,我希望有人能帮我完成 if ($reportData['refund_amount_ex'] > $reportData['returned_products_cost_amount'] = $reportData['profit'] = + $reportData['profit']); else $reportData['profit'] = - $reportData['profit']; 如果应该,如果退款金额大于产品成本,则应= 目前我们

我已经疯了,我读了所有我能找到的东西,我希望有人能帮我完成

if ($reportData['refund_amount_ex'] > $reportData['returned_products_cost_amount'] = $reportData['profit'] = + $reportData['profit']);

else $reportData['profit'] = - $reportData['profit'];
如果应该,如果退款金额大于产品成本,则应=

目前我们只看到其他的

事先非常感谢 谢谢 罗素这对你有帮助吗

if ($reportData['refund_amount_ex'] > $reportData['returned_products_cost_amount'])
       $reportData['profit'] =+ $reportData['profit'];
 else 
    $reportData['profit'] =- $reportData['profit'];

这就是你想做的我相信

if ($reportData['refund_amount_ex'] > $reportData['returned_products_cost_amount']){
    $reportData['profit'] =+ $reportData['profit'];
}else{ 
    $reportData['profit'] =- $reportData['profit'];
}

我只是很快地看了看,但你应该退房


这是unicornphp。你最好阅读一些关于PHP如何工作的教程。我认为你不明白
if
else
是什么意思。。。
=+
到底是什么意思?阅读
和[&&]
或[||
或[|||]
条件中的语句这并不是他想要的
+=
=+
不同,在
['profit'之后还有一个
这将导致错误发生……最好先链接到//的php手册,然后再链接。
if ($reportData['refund_amount_ex'] > $reportData['returned_products_cost_amount']){ 
$reportData['profit'] =+ $reportData['profit'];
}

else { 
$reportData['profit'] =- $reportData['profit'];
}