 <pre><code>$data = file_get_contents('yourfile.txt'); echo '&lt;textarea&gt;', htmlspecialchars($data), '&lt;/textarea&gt;'; </code></pre> <p>The <a href="http://php.net/manual/en/function.file-get-contents.php" rel="nofollow"><code>file_get_contents()</code></a> loads the data, and then you just need to echo it. Using <a href="http://php.net/manual/en/function.htmlspecialchars.php" rel="nofollow"><code>htmlspecialchars()</code></a> takes care of escaping any of the data, as needed in the context of HTML.</p>