I have this piece of code where I need to output some $_POST
values into HTML. Nothing happens in the output line (see comment inside the code), even though var_dump()
shows that the needed values are in the array and under the desired indexes.
The trick is that the array indexes for the required data depend on the counter $i
. I'm feeling like there is some really stupid and basic syntax mistake in this code. Please help me, oh almighty Hivemind!
while ($i < $somespecificvar)
{
if (($i != 0) AND ($i < $somespecificvar))
{
echo "\n<td></td>\n";
}
echo "<td>";
if ($_POST["text_l$i"] != 0)
{
echo "{$_POST['text_l$i']}, {$_POST['l$i']}";// NOTHING HAPPENS OVER HERE
}
echo "</td>";
$i++;
}