Something
public php v1 · immutablefunction do_stuff($array){ $count = count($array); for ($i = 0; $i < $count; $i++) { $item = $array[$i]; $c = count($item); if ($c == 1) { $item = trim($item); echo "$item <input type='text' name='T$i' size=20 />\n"; } else { for ($j = 0; $j < $c; $j++) { $v = trim($item[$j]); echo "<input type='radio' name='R$i' value='$v' />\n"; } } }}