');#Ищем вредное ">",, "<"
$new1 = array('
');#Меняем на полезное">", , "<"
$text = str_replace($old1, $new1, $text);#Собсно сама замена =)
return $text; }
$src='/media/backup/goodhtml';
function list_file ( $dir ) {
if ( $dir [ strlen( $dir ) - 1 ] != '/' )$dir .= '/';
$nDir = opendir( $dir );
while ( false !== ( $file = readdir( $nDir ) ) )
{if ( $file != "." AND $file != ".." ){
if ( !is_dir( $dir . $file ) )$files [] = $file;}
}closedir( $nDir );
return $files;}
//Получаем список файлов
$all_files=list_file($src);
//Ищем нужный файл
$count = count($all_files);
for($x=0; $x<$count; $x++){
$txt = "";
$fd = fopen( $src . '/' . $all_files[$x], "r");
while (!feof($fd)) {
$txt .= fgets($fd, 5000);
}
fclose ($fd);
$begin1=strpos($txt, '', 0);
//echo $begin . "\n";
$rest = substr($txt, $begin1, strlen($txt));
//$begin=strpos($txt, '
');
//$rest = substr($txt, $begin1, $begin-1);
//echo $rest;
$f = fopen($src . '/' . $all_files[$x], 'w');
fputs($f,replacer_param( $rest ) );
fclose($f);
}
//очищаем конец
for($x=0; $x<$count; $x++){
$txt = "";
$fd = fopen( $src . '/' . $all_files[$x], "r");
while (!feof($fd)) {
$txt .= fgets($fd, 5000);
}
fclose ($fd);
$begin1=strpos($txt, '
', 0);
//echo $begin . "\n";
$rest = substr($txt, 0, $begin1) . '';
//$begin=strpos($txt, '');
//$rest = substr($txt, $begin1, $begin-1);
//echo $rest;
$f = fopen($src . '/' . $all_files[$x], 'w');
fputs($f,replacer_param( $rest ) );
fclose($f);
}
?>