I'm looking to create a php function that can trim each line in a long string.
eg:
<?php
$txt = <<< HD
This is text.
This is text.
This is text.
HD;
echo trimHereDoc($txt);
output:
This is text.
This is text.
This is text.
Yes, I know about the trim() function. Just not sure how to use it on a long strings such as heredoc.