Jump to content

Archived

This topic is now archived and is closed to further replies.

newb

removing html?

Recommended Posts

if a string contains html code, how do you output without it? for example:
[code]
<?php
$string = "<b>hi</b>";
echo $string;
?>
[/code]

the string wont be bold, it will just be 'hi' without the bolding.

Share this post


Link to post
Share on other sites
Take a look at [url=http://us2.php.net/manual/en/function.strip-tags.php]strip_tags[/url]

just do something like this

[code=php:0]
$string = strip_tags('<b>hi</b>');
echo $string;
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.