How to convert BR to New Line using PHP Home › Forums › PHP › How to convert BR to New Line using PHP This topic has 0 replies, 1 voice, and was last updated 6 years, 11 months ago by Usman Haider. Viewing 1 post (of 1 total) Author Posts June 11, 2015 at 7:45 pm #663 Usman HaiderKeymaster BR HTML tag is used for line breaking in normal HTML. What if you want a new line inside a textarea? Here is what PHP can do for you by converting a BR tag into a new line for using in these kind of situations: Convert a BR tag into a new line using PHP function convert_br_to_newline( $text ) { $text = str_ireplace( array("<br>","<br />","<br/>"), "\n", $text ); return $text ; } 1234 function convert_br_to_newline( $text ) { $text = str_ireplace( array("<br>","<br />","<br/>"), "\n", $text ); return $text ;} Author Posts Viewing 1 post (of 1 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In