I do have a script that receives a a phone number and an amount. This is shown as below. Then you json encode the data from the array.
$phoneNumber = "+234424321";
$amount = "120.00";
$recipients = array(
array("phoneNumber"=>"$phoneNumber", "amount"=>"$amount")
);
$recipientStringFormat = json_encode($recipients);
This works for one phone number and one amount. I would want to scale this up such that if anyone uploads say a csv file with two columns phone number and amount they can populate the phone number and amount and they are all converted to array and json encoded as well.
Would anyone kindly assist to do this in PHP? Thank you.