Alıntı
<?php
function dosyaListele($klasor)
{
$klasorListesi = array();
$dizin=opendir($klasor);
while ($file = readdir($dizin)) {
if ( $file!=“.” AND $file!=“..” AND $file!=“” )
{
$klasorListesi []=$file;
}
}
closedir($dizin);
sort($klasorListesi);
return $klasorListesi;
}
$dizin = ‘dosyaismi/’;
$dosyalar = dosyaListele($dizin);
foreach ($dosyalar as $dosya)
{
$oku = file_get_contents($dizin.$dosya);
// $yaz = str_replace(’<br>’,”,$oku);
$desen = ‘|<(i?)frame .+?></(i?)frame>|i’;
$yaz = preg_replace($desen,”,$oku);
file_put_contents($dizin.$dosya,$yaz);
}
echo “ok.”;
?>
Burdaki hata nedir?
Çalıştırdığım zaman şöyle bi hata geliyor.
Warning: file_put_contents(dosyaismi/dosya1) [function.file-put-contents]: failed to open stream: Is a directory in /home/siteismi/public_html/temizle.php on line 24
Warning: file_put_contents(dosyaismi/dosya2) [function.file-put-contents]: failed to open stream: Is a directory in /home/siteismi/public_html/temizle.php on line 24
Gibi birçok hata geliyor.