<?php $string = "This is a string\n with newline\n" . "\xC2\xA0" . "and special character\n"; $cleaned_string = preg_replace(['/\R/u', '/\xC2\xA0/u'], ['/n', ''], $string); var_dump($string, $cleaned_string);
You have javascript disabled. You will not be able to edit any code.