(.*?)#is', $content, $text); $text = preg_replace('##', '', $text[1][4]); $text = preg_replace('#

.*?

#', '', $text); $text = preg_replace('#

#', '', $text); $text = preg_replace('#

#', '', $text); $text = preg_replace('#\n#', '', $text); $f = fopen("text.txt","a+"); fwrite($f, $text); fwrite($f, "\r \n"); fclose($f); $i++; } echo 'Готово'; ?>