remove all html from string and line breaks php code example Example: remove line break html php preg_replace( "/\r|\n/", "", $yourString );