PHP code: <?php $text = file_get_contents('advertisements.txt'); preg_match_all('~"text"\s+"([^"]*)~', $text, $matches); $arr = str_replace('\n', "<br>", $matches[1]); echo ("<li>"); echo implode("<br /><li>\n", $arr); ?>