<h1>heading 1</h1> <h2>heading 2</h2> <h1>heading 1</h1> <h2>heading 2</h2> <h3>heading 3</h3>
<div class="sect1"> <h1>heading 1</h1> <div class="sect2"> <h2>heading 2</h2> </div> </div> <div class="sect1"> <h1>heading 1</h1> <div class="sect2"> <h2>heading 2</h2> <div class="sect3"> <h3>heading 3</h3> </div> </div> </div>
$doc = new DOMDocument(); $doc->loadHTML($input); $div = $doc->createElement("div"); $div->setAttribute('class', 'sect1'); $h1= $doc->getElementsByTagName('h1'); $div->appendChild($h1); ??????
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)