i have a code get content of a file and remove empty lines in this:
$content = preg_replace("/([\r\n]){2,}/m", "\\1", $content);
but it doesn't remove empty line at first of file.
And remove whitespace from the start and the end of lines:
$content = preg_replace( "/^[ \t]|[ \t]$/s", '', $content);
-> not work 🙁
Anyone help me?
Apologies for my bad english.