This is what i have:
ob_start();
for ($i=0; $i<count($_POST['checkbox_checker']);$i++) {
echo "<br />".$_POST['checkbox_checker'][$i];
$selection = ob_end_flush();
}
I am then using $selection to store in a database since i am unable to find a way to use sessions to store checkboxes. The problem is when i use $SELECTION = ob_end_flush(); the values still echo. How can i make it so the values that are supposed to be echoed get stored inside of $selection and don’t show to the user?
The actual solution, btw, would be to not use the
echo. You don’t need that workaround if you just append to a string variable:(And you could also read up on
foreach. Or evenimplode()in this case.)