PDA

View Full Version : How can i parse HTML from strings?


FatalBreeze
06-13-2007, 08:12 AM
Hi!
i am building a content system, and i'm using a WYSIWYG toolbar, the data is stored in the DB, and in another page there is a query:


$result = mysql_query("SELECT * FROM pages WHERE pid='3'");


when i fetch the sql and when i echo it, the output is:

<STRONG>Hello</STRONG>


and of course i dont want it to show up as an html code! i want it to be a bold "hello".
How can i change this? and please be more spesific than ereg_replace.

in other words, there is a field in my DB that stores "<Strong>Hello</strong>".
when i fetch it, the output is "<Strong>Hello</strong>" and i want it to act as HTML and to be seen as a bold Hello, and not as a plain text.

Thanks :)

cyberphr
06-13-2007, 09:40 AM
$text = "Hello, World!";

If that's not what you want, be more specific...

FatalBreeze
06-13-2007, 09:43 AM
I changed the post, now its clearer.

Dismounted
06-13-2007, 09:44 AM
$text = strip_tags($text);

FatalBreeze
06-13-2007, 09:50 AM
It doesn't work Dismounted.
Though i used this function, the output remains
<strong>Hello</strong>

I think you read the first post, before i edited it. It's completely different.

nevermind guys i found it!
It's called html_entity_decode!!!!!!!! :)