I\'m looking to create a PHP function that can trim each line in a long string.
For example,
function trimHereDoc($txt) { return preg_replace('/^\h+|\h+$/m', '', $txt); }
While \s+ removes empty lines, keeps \h+ each empty lines
\s+
\h+