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) Link to comment https://forums.phpfreaks.com/topic/77324-solved-is-it-possible-to-strip-string-formats/ Share on other sites More sharing options...
GingerRobot Posted November 14, 2007 Share Posted November 14, 2007 strip_tags()? Link to comment https://forums.phpfreaks.com/topic/77324-solved-is-it-possible-to-strip-string-formats/#findComment-391488 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); ?> Link to comment https://forums.phpfreaks.com/topic/77324-solved-is-it-possible-to-strip-string-formats/#findComment-391490 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! Link to comment https://forums.phpfreaks.com/topic/77324-solved-is-it-possible-to-strip-string-formats/#findComment-391491 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.