How to Transform a String from Multi-Line to Single-Line in PHP? zendnwar August 18, 2014 PHP Basic 1 Comment It is very simple. Just add below code. echo str_replace(array(“\r”,”\n”),””, $str); Related Posts Revolution of PHP 7: Usage of Return Types and Removal of Artifacts zendnwar January 29, 2015 28 January 2015 Boston: As the date for PHP 7’s release is approaching rapidly, the group is .. What’s the difference between htmlentities() and htmlspecialchars() in php? zendnwar July 20, 2012 htmlspecialchars: Convert special characters to HTML entities. htmlentities: Convert all appl ..