<?php
/* 
	Хочу получить
	
<div class="block">
<h1>Первая строчка</h1>
<ul>
<li>Вторая строчка</li>
<li>Третяя строчка</li>
</ul>
</div>
*/

$text = <<<HTML
<ul>
<li>Первая строчка</li>
<li>Вторая строчка</li>
<li>Третяя строчка</li>
</ul>
HTML;

#$text  = preg_replace('/о/', "", $text); 
$text = str_replace("<ul>", "<div class='block'>\n<ul>", $text);
$text = str_replace("</ul>", "</ul></div>", $text);
echo $text;
