PHP array in another array issue -
hy, trying output in array in implode function gives me weird error. code below.
$users_balance = users::all_uww_balance(); // query take balance users $users_pay = array(); foreach($users_balance $user_balance) { $users_pay[] = formatbtc(converttobtcfromsatoshi($user_balance->balance)); } $users_wallet = users::all_uww_wallet(); query take addresses users $users_pay_wallet = array(); foreach($users_wallet $user_wallet) { $users_pay_wallet[] = $user_wallet->wallet; } try { $withdrawinfo = $block_io->withdraw(array('amounts' => implode(", ", $users_pay), 'to_addresses' => implode(", ", $users_pay_wallet) )); echo "status: ".$withdrawinfo->status."\n"; echo "executed transaction id: ".$withdrawinfo->data->txid."\n"; echo "network fee charged: ".$withdrawinfo->data->network_fee." ".$withdrawinfo->data->network."\n"; } catch (exception $e) { echo $e->getmessage() . "\n"; } }
i have 2 demo users 0.0005 balance both.
implode(", ", $users_pay)
should output 0.0005,0.0005
instead output 0.00050.0005,0005.
Comments
Post a Comment