[thelist] HOWTO read PHP source code into a textarea
Keith Gaughan
keith at digital-crew.com
Fri Feb 25 10:08:16 CST 2005
Michael Pemberton wrote:
> The code you would need is something like this:
>
> <textarea>
> <?php
> echo implode('', file('nav.php'));
> ?>
> </textarea>
>
> This is just a quick example, you can throw in some error checking and
> such stuff yourself.
Slight correction:
<textarea>
<?php echo htmlentities(implode('', file('nav.php'))); ?>
</textarea>
Without the htmlentities() call, strange and nasty things could happen
because the < and > characters haven't been escaped.
K.
More information about the thelist
mailing list