Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Файл с тредом
- $file = 'thread.html';
- $str = file_get_contents ($file);
- preg_match_all ('#<blockquote id="m([0-9]+(00|11|22|33|44|55|66|77|88|99))" class="post-message">(.+)</blockquote>#uisU', $str, $out);
- $result = array ();
- $n = 0;
- foreach ($out[3] as $key => $value)
- {
- // Уберем ссылки
- $value = preg_replace ('#<a href=(.+)</a>#uisU', '', $value);
- // Спойлеры
- $value = str_replace ('<span class="spoiler">', '', $value);
- $value = str_replace ('</span>', '', $value);
- // Переносы
- $value = str_replace ('<br>', '', $value);
- // Жирный шрифт
- $value = str_replace ('<strong>', '', $value);
- $value = str_replace ('</strong>', '', $value);
- $result[++$n] = trim ($value);
- }
- // Выводим
- foreach ($result as $str)
- {
- echo $str . '<hr />' . "\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment