$end_type = end($CONFIG['file_types']); $types = ''; foreach($CONFIG['file_types'] as $key){ if($key == $end_type){ $types .= 'and .'.strtoupper($key); }else{ $types .= '.'.strtoupper($key).', '; } } PHP: <?php echo $types; ?> PHP: www.freefileuploader.com I'm trying to get the file types to have a linebreak every 10 so that it doesn't stretch the page. I tried... $brten = count($types); if ($brten = "10") { echo "ten"; } PHP: but that doesn't seem to work. Thanks for any help!
you could try this $count = 0 ; foreach($CONFIG['file_types'] as $key){ if($key == $end_type){ $types .= 'and .'.strtoupper($key); } else $types .= '.'.strtoupper($key).', '; echo "$types"; if(bcmod($count , 10) == 0) { echo "<br>" ; } $count++; } PHP:
Replace if(bcmod($count , 10) == 0) PHP: With if (++$count % 10 == 0) PHP: And remove this: $count++; PHP: