my question is as follows.
I owe x friends y amount of money.
I have Fixed amount of money to payback right now.
I need to pay back each friend evenly.
example: $1 amy then $1 Amdy and so forth till my fixedAmount is used up.
for instance.
$fixedAmount = 10; $arr = array("amy" => 5,"amdy" => 55,"amfy" => 15);
thanks in advance for any help offered.
getting this answered when i have enough Fixed Amount of money to pay back everyone I got it working as below.
$a = array_sum($arr);
if($fixedAmount >= $a) {
echo 'fully paid';
}
now the problem is what if i dont have enough money to pay back everyone?
honestly dont know which functions or what is best to use to get the result.