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.. Quote 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 ); Quote 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> Quote 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(). Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.