0

我对 sendfrom 有一个非常奇怪的问题。为了处理我使用 $_POST 收到的表单中的动态值。

$myaccount = trim($_POST['myaccount']);
$to_wallet = trim($_POST['to_wallet']);
$wammount = trim($_POST['wammount']);

我可以回显它们,我可以清楚地看到从表单传递的所有数据

现在我将它们插入

$message = ($bitcoin->sendfrom($myaccount, $to_wallet, $wammount));

我发现所有 $myaccount、$to_wallet 都正确传递,但 $wammount 导致问题并且代码未执行。我在“wammount”字段中插入表单 0.0001 但是一旦这是硬编码

$myaccount = trim($_POST['myaccount']);
$to_wallet = trim($_POST['to_wallet']);
$wammount = 0.0001;

并在下面运行命令一切运行良好并处理事务。知道为什么吗?

$message = ($bitcoin->sendfrom($myaccount, $to_wallet, $wammount));
4

1 回答 1

2

添加有什么作用floatval()

$wammount = floatval(trim($_POST['wammount']));
于 2013-09-23T14:14:33.920 回答