FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How to "quote code" in PHP?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How to "quote code" in PHP? [message #174033 is a reply to message #174031] Fri, 20 May 2011 00:47 Go to previous messageGo to previous message
Jeff North is currently offline  Jeff North
Messages: 58
Registered: November 2010
Karma:
Member
On Thu, 19 May 2011 23:31:47 +0100, in comp.lang.php "Mentalguy2k8"
<Mentalguy2k8(at)gmail(dot)com>
<ir45oo$mik$1(at)dont-email(dot)me> wrote:

> | I'm trying to put together a little page with a form, so that users can
> | "translate" any URL into the correct format for posting on a forum.
> |
> | For instance, they want to share a link and type in "www.google.com"
> | (without quotes) and the form turns it into "<a href="www.google.com"></a>"
> | (without the beginning and end quotes) and displays that as text, so that
> | they can copy/paste it into the forum post box. It will also include an
> | image-posting version so that it adds the "<img src" etc to an image URL.
> |
> | How do I "quote" the result so that it displays as plain text rather than a
> | mess? All I'm getting is a mess of blue code.

A "mess of blue code" could mean that you are not appending the
closing </a>.

To display the text you need to convert < to &lt; and > to &gt; so
your code would look like:
&lt;a href="www.google.com"&gt;&lt;/a&gt;
Have a look at htmlentities
http://au.php.net/manual/en/function.htmlentities.php
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Regular Expressions
Next Topic: php5-xdebug backported to squeeze from SVN 2.2.0 with trigger functionality
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 12 22:45:59 GMT 2024

Total time taken to generate the page: 0.05269 seconds