Dynamic PHP Array used in sendmany bitcoin command issue
Have you tried:
$bitcoin -&gt; sendmany($BuyerAccount, $to);?
Bitcoin API states &lt;fromaccount&gt; {address:amount,...} [minconf=1] [comment] as parameters, so you don't have to iterate - pass the whole array.
If it doesn't work somehow, you can also prepare request by yourself for RPCClient. This is example for sendfrom:
                $request = '{"method":"sendfrom","params":["'.$params[0].'","'.$params[1].'",'.$params[2].','.$params[3].'],"id":'.$currentId.'}';