pickachu Posted October 20, 2008 Share Posted October 20, 2008 Hi, how do i remove a br tag inside ONLY a pre tag.. example: <pre> <br>PHPFREAKS </pre> result should be: <pre> PHPFREAKS </pre> Link to comment https://forums.phpfreaks.com/topic/129188-how-to-remove/ Share on other sites More sharing options...
Bendude14 Posted October 20, 2008 Share Posted October 20, 2008 http://au.php.net/str_replace Link to comment https://forums.phpfreaks.com/topic/129188-how-to-remove/#findComment-669779 Share on other sites More sharing options...
pickachu Posted October 20, 2008 Author Share Posted October 20, 2008 thanks.. but what i mean is, i want to search the whole html then remove only those br tags that are inside a <pre> tag.. is that possible? Link to comment https://forums.phpfreaks.com/topic/129188-how-to-remove/#findComment-669780 Share on other sites More sharing options...
Bendude14 Posted October 20, 2008 Share Posted October 20, 2008 ah i see... well i suppose it would be possible if the <br> always came directly after the <pre> tags? otherwise i wouldn't know how you would do that... Link to comment https://forums.phpfreaks.com/topic/129188-how-to-remove/#findComment-669782 Share on other sites More sharing options...
ratcateme Posted October 20, 2008 Share Posted October 20, 2008 you could get the position of a <pre> tag then find the position of the next </pre> and remove all of the <br>s in between look at strpos() the offset would help i think once you got the text between each <pre> you would have to go though it <br> by <br> so not to leave the <pre> tag. Scott. Link to comment https://forums.phpfreaks.com/topic/129188-how-to-remove/#findComment-669793 Share on other sites More sharing options...
pickachu Posted October 20, 2008 Author Share Posted October 20, 2008 what do you think is best.. convert all the bbcodes into html then insert on dbase or convert those bbcodes while displaying records? Link to comment https://forums.phpfreaks.com/topic/129188-how-to-remove/#findComment-669803 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.