newb Posted October 9, 2006 Share Posted October 9, 2006 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. Quote Link to comment Share on other sites More sharing options...
tomfmason Posted October 9, 2006 Share Posted October 9, 2006 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] Quote Link to comment Share on other sites More sharing options...
newb Posted October 9, 2006 Author Share Posted October 9, 2006 Oh, ok. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.