I have values from database trying to add the next value with the initial value then insert into an array, can somebody help me here, please?
while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {
$balance[] = (round($row["Balance"], 2))++;;
}
Scenario:
I have 1,2,3,4,5 values
I want to get these values into an array as below:
{1,3,6,10,15}
That is:
{1, (1+2), (1+2+3), (1+2+3+4), (1+2+3+4+5)}
Any one with an idea?