Solarpitch Posted November 14, 2007 Share Posted November 14, 2007 Hey guys, My application allows user's to format text before uploading to the database. It is then stored in the database as for example.. <strong>Header:</strong><br /><br />This is text inside... Is their any php function or way to strip the format values when I want to display them in a result set on the page. So in theory, I want to have it displayed as normal. Header: This is text... (without the bold and breaks) Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted November 14, 2007 Share Posted November 14, 2007 strip_tags()? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted November 14, 2007 Share Posted November 14, 2007 strip_tags(). you can decide which tags are not stripped out OR you could use a preg_replace... <?php $takeout = array('/<(\/)?bold>/','/<(\/)?strong>/','/<br( \/)?>'); $str = preg_replace($takeout,'',$astring); ?> Quote Link to comment Share on other sites More sharing options...
Solarpitch Posted November 14, 2007 Author Share Posted November 14, 2007 Cheers, I didnt know about that function! 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.