How to Transform a String from Multi-Line to Single-Line in PHP?

It is very simple.

Just add below code.

echo str_replace(array(“\r”,”\n”),””, $str);