Posted by shimmyshack on 05/11/07 16:45
On 11 May, 17:38, harvey <harvey....@blueyonzders.com> wrote:
> How do I get a text string that may contain HTML tags to
> echo out to a web browser verbatim?
>
> IE I want the tags to be printed out - not interpreted.
>
> Thanks
$string = '<h1>likethis</h1>';
echo htmlentities( $string );
//or
echo highlight_string( '<?php' . $string . '?>' );
//where adding <?php is a trick to highlight non-php, if you dont
mind the php tags appearing.(u could kill them afterwards)
Navigation:
[Reply to this message]
|