<?php
header("Content-Type: text/plain; charset=utf-8");
?> 
<?php

mb_internal_encoding("UTF-8");
$text = <<<TEXT
 <head>
 <b><!-- <i> это комментарий -->
<title>Форма заказа товара</title>
<meta http-equiv="Content-type" content="text/html" charset="windows-1251">
<meta name="keywords" content="">
<meta name="description" content="">
<div>
     <empty>
     </empty>
     <p>
       This is yet another text
       <br/>
       that wasn't
       <b>
         compliant
       </b>
       too...
       <br/>
     </p>
     <div class="noClass">
       this one is better but we don't care anyway
     </div>
TEXT;
echo $text;
$pattern = "/(<([\w]+)[^>]*>)/";
preg_match_all($pattern, $text, $new, PREG_SET_ORDER);
foreach ($new as $k => $v) {
    print_r($new[$k][2]);
    echo "\n";
}