Ben’s solution is acceptable, but str_replace() is by far faster than preg_replace()
$buffer = str_replace(array("\r", "\n"), '', $buffer);
Using less CPU power, reduces the world carbon dioxide emissions.
More Related Contents:
- How can I replace newline or \r\n with ?
- line breaks in a textarea
- How to strip a tag and all of its inner html using the tag’s id?
- Convert all types of smart quotes with PHP
- Remove all the line breaks from the html source
- Convert clickable anchor tags to plain text in html document
- find and replace keywords by hyperlinks in an html fragment, via php dom
- Parse error: syntax error, unexpected T_STRING in C:\wamp\www\b_php\project\login_save.php on line 14 [closed]
- Array to string conversion in php check my code
- Pagination data
- Grabbing the href attribute of an A element
- How to get multiple selected values of select box in php?
- How to solve PHP error ‘Notice: Array to string conversion in…’
- Set up the base url in codeigniter
- Preserve Line Breaks From TextArea
- Send value of submit button when form gets posted
- php link to image file outside default web directory
- Save current page as HTML to server
- Converting into a new line for use in a text area
- Need a good regex to convert URLs to links but leave existing links alone
- display data from SQL database into php/ html table [closed]
- Search and replace multiple values with multiple/different values in PHP5?
- What is the best practice to use when using PHP and HTML?
- How can I view/open a word document in my browser using with PHP or HTML
- Output text file with line breaks in PHP
- How to add anchor tag to a URL from text input
- Scroll bar for Datalist in HTML5
- Browser displays � instead of ´
- Conditional Statements in PHP code Between HTML Code
- jQuery Mobile: Sending data from one page to the another