By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,731 Members | 1,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,731 IT Pros & Developers. It's quick & easy.

Want to display &#__; characters

P: n/a
Hello,

I have several characters in my html code like / W and so
on....
The problem is, tehy are converted in HTML in their approbiate
characters like @ is @ and F is F

But I DONT want to display the F or the @ I want to display on my site
the &# codes like @

How can i do that?

Thanks mikel
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
mikel wrote:
Hello,

I have several characters in my html code like / W and so
on....
The problem is, tehy are converted in HTML in their approbiate
characters like @ is @ and F is F

But I DONT want to display the F or the @ I want to display on my site
the &# codes like @

How can i do that?


Well? A way could be...

http://php.net/htmlentities

Or just str_replace('&', '&', $foo);

Regards,
Johan

Jul 17 '05 #2

P: n/a
"Johan Holst Nielsen" <jo***@weknowthewayout.com> wrote in message
news:3f**********************@dread14.news.tele.dk ...
mikel wrote:

I have several characters in my html code like / W and so
on....
The problem is, tehy are converted in HTML in their approbiate
characters like @ is @ and F is F


Well? A way could be...

http://php.net/htmlentities

Or just str_replace('&', '&amp;', $foo);

Regards,
Johan


This problem is not really related to PHP, it is a HTML issue, your browser
reads those symbols as special characters when they are put next to
eachother. So,

Johan is right, the best way would probably be to do like this:

echo htmlentities('&#70');

--
Thomas
Jul 17 '05 #3

P: n/a
Regarding this well-known quote, often attributed to mikel's famous "2 Dec
2003 04:57:23 -0800" speech:
Hello,

I have several characters in my html code like / W and so
on....
The problem is, tehy are converted in HTML in their approbiate
characters like @ is @ and F is F

But I DONT want to display the F or the @ I want to display on my site
the &# codes like @

How can i do that?

Thanks mikel


Basically, you have to escape the escape character... make the ampersand an
ampersand, not a special character...

HTML-code it &amp;#64; (using PHP, coding-it-like-that, however you want),
and it'll display as "@".

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.