我要获取用户输入的自定义金额以在Web上付款,我正在使用Payeer com api 我如何获得数组内的自定义金额。
可变自定义金额
$ trans->美元
我尝试关注但未遵循工作代码
<?php
$m_shop = '547754002';
$m_orderid = '1';
$m_amount = $trans->usd;
$m_curr = 'USD';
$m_desc = base64_encode('Test');
$m_key = 'Your secret key';
$arHash = array(
$m_shop,
$m_orderid,
$m_amount,
$m_curr,
$m_desc
);
答案 0 :(得分:-1)
您可以使用array_push
功能。您的代码将是
<?php
$m_shop = '547754002';
$m_orderid = '1';
$m_amount = $trans->usd;
$m_curr = 'USD';
$m_desc = base64_encode('Test');
$m_key = 'Your secret key';
$arHash = array();
array_push(
$arHash,
$m_shop,
$m_orderid,
$m_amount,
$m_curr,
$m_desc
)