1. 정규식을 통한 제거


1
$text = preg_replace('/\r\n|\r|\n/','',$text); 
cs




2. 문자열 함수사용으로 제거


1
$text = str_replace(array("\r\n","\r","\n"),'',$text); 
cs

또는


1
$text = strtr($text,array("\r\n"=>'',"\r"=>'',"\n"=>''));
cs


+ Recent posts