Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的 PHP 脚本中,我得到了 A=BC
$A = $data['B']-$_POST[C];
我想减去 50 或任何数值。
但我想要 A= B-C-50
A= B-C-50
那么它的php代码是什么。
并告诉我,如果我想要减去那个值的百分比,比如
A = B-C-(B*10)/100 (10% of B)
您需要下一个代码:
$A = $data['B'] - $_POST['C'] - 50; //for your first question $A = $data['B'] - $_POST['C'] - ($data['B']*0.1); //for second question