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 Function ereg_replace() is deprecated zendnwar August 31, 2012 Function ereg_replace() is deprecated : Example : print $input.”<hr>”.ereg_re .. Regular Expressions Examples zendnwar July 27, 2012 Regular Expressions Examples Regular Expressions for Username Pattern : /^a-z0-9_-{3,16}$/ Desc ..