Показать сообщение отдельно

  #9  
Старый 23.01.2010, 14:22
Deathdreams
Постоянный
Регистрация: 08.11.2008
Сообщений: 498
С нами: 9213376

Репутация: 278
По умолчанию

PHP код:

$dir 
= getcwd().DIRECTORY_SEPARATOR; // папка, сейчас указана папка, из которой запускается скрипт.
if ($handle = opendir($dir)) {
    echo 
"Directory handle: $handle <br />";
    echo 
"Stream: <br />";

    
    while (
false !== ($file = readdir($handle))) {
              
$array = explode(".", $file);
              
$ext = end($array);
              if( ( 
$file !== '.' || $file !== '..' ) && $ext == "php" ) {
                     if(
rename($dir.$file, $dir.str_replace("good", "best", $file)) echo "$file successfully renamed";
              }
    }

   echo 
"<br /> ---------- <br /> All Files: <br />";
    while (
$file = readdir($handle)) {
              if( 
$file !== '.' || $file !== '..' ) {
        echo 
"$file<br>";
               }
    }

    
closedir($handle);
} 
Не пробовал.
 
Ответить с цитированием