I have to keys, 'payment_date' and 'balance'. I have a function that checks 'payment_date' to see if it's <= 'today', and it works but now I don't know how to fetch 'balance' from that:
function getCurrentBalance($myTable){
$today = new DateTime('now');
$today = $today->format('Y-m-d');
foreach($myTable as $row) {
foreach($row as $key=>$value) {
if ($key == "payment_date" && $value <= $today){
}
}
}
}