CODE:
while (false !== ($file = $d->read())) {
if (is_dir($avatarsdir.'/'.$file) || !preg_match("#\.{gif|jpg|bmp|png|jpeg|pjpeg}$#is",$file)) {
continue;
}
if ($file == $fm->user['avatar']) {
$avatars_select .= '<option value="'.$file.'" selected>'.$file."</option>\n";
} else {
$avatars_select .= '<option value="'.$file.'">'.$file."</option>\n";
}
}
if (is_dir($avatarsdir.'/'.$file) || !preg_match("#\.{gif|jpg|bmp|png|jpeg|pjpeg}$#is",$file)) {
continue;
}
if ($file == $fm->user['avatar']) {
$avatars_select .= '<option value="'.$file.'" selected>'.$file."</option>\n";
} else {
$avatars_select .= '<option value="'.$file.'">'.$file."</option>\n";
}
}
(Добавление)
добабил палку- работает))
CODE:
if (is_dir($avatarsdir.'/'.$file) || !preg_match("#\.{|gif|jpg|bmp|png|jpeg|pjpeg}$#is",$file))