I have several $_POST variables, they are
$_POST[\'item_number1\']
$_POST[\'item_number2\']
and so on
I need to write a loop tha di
If you know how many do you have:
for ($i=0; $i < $num_of_vars; $i++)
echo $_POST['item_number'.$i]."
";
UPDATE: If not:
foreach($_POST as $k => $v) {
$pos = strpos($k, "item_number");
if($pos === 0)
echo $v."
";
}
Gets all POST variables that are like "item_number"
UPD 2: Changed "==" to "===" because of piotrekkr's comment. Thanks