Jump to content

[SOLVED] Adding Values


cheechm

Recommended Posts

You're probably better off just defining individual variables.

 

$cost1 = $_POST['cost1'];
$cost2 = $_POST['cost2'];
$cost3 = $_POST['cost3'];

 

Or something like

 

$cost[] = $_POST['cost' . $i]; // inside your while statement
echo array_sum($cost); // after your while statement

Link to comment
https://forums.phpfreaks.com/topic/120120-solved-adding-values/#findComment-618830
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.