if (file_exists('./img')) foreach (glob('./img/*') as $file) unlink($file); echo("Файлы каталога успешно удалены, обновите страницу"); if (file_exists('./img')) { foreach (glob('./img/*') as $file) { if ($file!='.htaccess') unlink($file); } echo("Файлы каталога успешно удалены, обновите страницу"); } if (file_exists('./img/mini_logo')) { include('db.php'); $query = 'SELECT img FROM zayav'; $res = mysql_query( $query ); $img = array(); while ( $item = mysql_fetch_array($res)) { $img3 = $item['img']; $way="./img/mini_logo/$img3.png"; $img[] = $way; } foreach (glob('./img/mini_logo/*') as $file) { if( !in_array( $file, $img)) unlink($file); } echo ""; }