I have a custom textarea are that I normally just output using 'nl2br'. In this particular case I need to wrap them in separate Paragraph tags, instead of have '<br/>'.
I'm currently using this:
$memberDescription = '<p>' . implode('</p><p>', array_filter(explode("\n", get_post_meta( get_the_ID(), 'members_' . $z . '_description', true )))) . '</p>';
My issue is that when I echo this out, it also outputs empty Paragraph tags (im guessing where extra line breaks are).
Any tips or tricks on how to alter this to remove the empty P-tags, or have them not even outputted, to begin with, would be greatly appreciated.
answer was what @fubar described above:
$memberDescription = '<p>' . implode('</p><p>', array_filter(explode("\r\n", get_post_meta( get_the_ID(), 'members_' . $z . '_description', true )))) . '</p>';