Jump to content

[SOLVED] make an array out of posts


MadnessRed

Recommended Posts

ok, will have several things coming from a form,

 

eg

 

$_POST[cost1]

$_POST[cost2]

$_POST[cost4]

$_POST[cost5]

$_POST[cost9]

$_POST[cost10]

$_POST[cost15]

$_POST[time1]

$_POST[time2]

$_POST[time4]

$_POST[time5]

$_POST[time9]

$_POST[time10]

$_POST[time15]

 

Now, can I make an array of all the "$_POST['cost'.*]"?

 

so that I can something like

 

echo max(array($_POST['cost'.*]));?

Link to comment
https://forums.phpfreaks.com/topic/118513-solved-make-an-array-out-of-posts/
Share on other sites

no its hidden.

 

$costs = "";
if ($_POST['ammount1'] >= 1){
[tab] $costs .= "<input type=\"hidden\" name=\"cost1\" value=\"20\" />";
}
if ($_POST['ammount2'] >= 1){
[tab] $costs .= "<input type=\"hidden\" name=\"cost2\" value=\"15\" />";
}
[ect ect ect]

  • 3 weeks later...

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.