Following script will work for remove the newline and remove the consecutive white spaces

function remW( $content )
{
$content = trim(ereg_replace(“\n|\r|\r\n|\n\r”, ”, preg_replace(‘/\s+/’, ‘ ‘, $content)));
return $content;
}

Categories: PHP Code

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *