|
Posted by shimmyshack on 05/11/07 17:04
On 11 May, 17:51, harvey <harvey....@blueyonzders.com> wrote:
> In article <1178901903.347883.242...@o5g2000hsb.googlegroups.com>,
> matt.fa...@gmail.com says...
>
>
>
> > 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)
>
> That was fast -
> I am a bit red faced as I actually recognise that command but thought it
> did something else !
>
> Your second method is a new one to me - I will experiment with that.
>
> thank you !
well i was too quick for my puny brain
it should be
highlight_string( '<?php ' . $string . ' ?>' );
of course!!
Navigation:
[Reply to this message]
|