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 if Statement Uses else zendnwar July 23, 2012 if Statement uses else When working with the if statement, you will often want to define an alt .. Regular Expression Basic Tutorial zendnwar July 27, 2012 Characters Character Description Example Any character except \^$.|?*+() All characters except ..