pickachu Posted October 21, 2008 Share Posted October 21, 2008 i wanted to remove the <br /> tag that are value of the <textarea></textarea>.. remove or replacing this.. Link to comment https://forums.phpfreaks.com/topic/129344-how-to-remove-tag-with-reg-ex/ Share on other sites More sharing options...
discomatt Posted October 21, 2008 Share Posted October 21, 2008 You don't need regex. str_replace( '<br />', '', $subject ); Link to comment https://forums.phpfreaks.com/topic/129344-how-to-remove-tag-with-reg-ex/#findComment-670880 Share on other sites More sharing options...
The Little Guy Posted October 24, 2008 Share Posted October 24, 2008 You could do this, it removes the br and places a line break in its place: <textarea><?= str_replace( '<br />', "\n", $subject ); ?></textarea> Link to comment https://forums.phpfreaks.com/topic/129344-how-to-remove-tag-with-reg-ex/#findComment-673883 Share on other sites More sharing options...
Maq Posted October 24, 2008 Share Posted October 24, 2008 If you're not using regex for finding a specific string then you should always use str_replace(). Link to comment https://forums.phpfreaks.com/topic/129344-how-to-remove-tag-with-reg-ex/#findComment-673975 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.