function removeEmptyLines($s)
{
return preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $s);
}Use the function to clean buffers of HTML, CSS or Javascript before outputting to browsers/clients. It will do a great deal of magic.
thephpcode is where your PHP resources flow and you can find tips and tricks of PHP coding. Code snippets and examples are also provided. Best of PHP are included in thephpcode. Remember, if you have questions, do post a comment on the relevant post.
function removeEmptyLines($s)
{
return preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $s);
}
2 programmer comments:
Short n sweet!
Like it!
thanks Dork!
Post a Comment