PHP删除Linux和Windows的字符串中的换行符

Nam*_* VU 1 php newline

目前我要打电话

    $html = str_replace($search="\r\n", $replace='', $subject=$html);
    $html = str_replace($search="\n",   $replace='', $subject=$html);
Run Code Online (Sandbox Code Playgroud)

删除new line字符串中的字符$html.有更好/更短的方式吗?

问候

Yos*_*shi 10

尝试:

$html = str_replace(array("\r", "\n"), '', $html);
Run Code Online (Sandbox Code Playgroud)