HTML Entities?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

HTML Entities?

Post by ianhull »

Hi Guys,

another little probelm here.

I have this in my database

My+%3CFONT+face%3D%22Arial+Black%22%3E%3CEM%3ETest%3C%2FEM%3E%3C%2FFONT%3E

When I retrieve it I need it to show it like it would be in say Word.

I have read something about html entities but what I tried does not work

I am using this

<?php echo $cpro ?> // which prints the html above.

Anyone know how to get it ot display with the font size etc?

thanks
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

You're wanting html_entity_decode()
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

This is a url encoded string, not html entities.

Use urldecode() http://us2.php.net/manual/en/function.urldecode.php
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Touché ;)
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
ianhull
Forum Contributor
Posts: 310
Joined: Tue Jun 14, 2005 10:04 am
Location: Hull England UK

Post by ianhull »

Thanks Guys,

urlencode($var); works great.

Much appreciated.
Post Reply