Good evening to the skilled Ladies and Gentlemen of the PHP world. I
am fairly new to all of this but learning quickly. I have run in to a
need to remove blank lines from a form submission after its sent back
to the web server for processing by a PHP document.
I have a textarea that users can paste lines of text in to and submit
them for inclusion in to a database. Every aspect is working
perfectly, except one. No matter what I try, I cannot get rid of
simple blank lines from the form submission.
$theLines = $HTTP_POST_VARS['userSubmitted'];
This variable ($theLines) now contains the contents from the textarea.
I have tried using ...
$theLines = explode("\n", $theLines);
and
$theLines = explode("\r", $theLines);
But all of the blank lines are still there. If anyone has some
snippet that they would share, I would be very grateful.
With great respect,
Martin