In the code below I would to add a break tag tag after the radio button displays 5 times. I tried few ways but keep getting the entire number of radio button to repeat.
foreach ($salary_tbl as $key=>$value) {
echo "<span class=\"year\">$key</span><input class=\"margin_r36\" type=\"radio\" value='$value' name='salary_tbl' /><br />";
}
this is what I tried
for ($i=1; $i<=10; $i++) {
if ($i < 5) {
foreach ($salary_tbl as $key=>$value) {
echo "<span class=\"year\">$key</span><input class=\"margin_r36\" type=\"radio\" value='$value' name='salary_tbl' /><br />";
}
}
}
Thanks
or if you want the line break every 5 records then you can slightly change the code to.
another suggestion of mine is, instead of using escape character
\you could simply use it with single quotes and concatenation operator which is much more readable.for example.
isn’t it much more readable now?