[code]<?php
echo '
<b>Emoticons: </b>
<table cellspacing="0" cellpadding="0" style="border:solid 2px #000000;">
	<tr>
		<td>
			<table cellspacing="0" cellpadding="5" width="100%">';
			
			$image_types = array("jpg","gif","bmp","png","jpeg");
			$plaatjes_reeks = "";
			$mapnaam = "/emoticon";
			if ( ereg('..',$mapnaam) || ereg('//',$mapnaam) ){
				$mapnaam = "/emoticon";
			}
			$map = opendir(".{$mapnaam}");
			$count = 0;
			while (false!==($bestand = readdir($map))) {
				if ($bestand != "." && $bestand != "..") {
					$ext = explode('.',$bestand);
					$extl = sizeof($ext) - 1;
					$ext = strtolower($ext[$extl]);
					if ( in_array($ext,$image_types) ){
					if($count%3 == 0) {
						$plaatjes_reeks .= '</tr><tr>';
					}
						$plaatjes_reeks .= "<td><img src=\"emoticon/" . $bestand . "\" /></td>";
						$count++;
					}
				}
			}                                                
			if ( $plaatjes_reeks != "" ){
				echo ($plaatjes_reeks);
			}
			closedir($map);
			
			echo '
			</table>
		</td>
	</tr>
</table>';
?> [/code]