Chuyển đổi BR sang Newline - Thủ thuật CSS

Anonim

Kỹ thuật số 1

function br2newline( $input ) ( $out = str_replace( "
", "\n", $input ); $out = str_replace( "
", "\n", $out ); $out = str_replace( "
", "\n", $out ); $out = str_replace( "
", "\n", $out ); $out = str_replace( "
", "\n", $out ); $out = str_replace( "
", "\n", $out ); return $out; )

Chuyển đổi thẻ ngắt thành dòng mới - bất kể loại HTML nào đang được xử lý.

Kỹ thuật số 2

function br2nl( $input ) ( return preg_replace('//i', "\n", $input); )