I have a unique problem, at least to me.
I have a form that posts to a PHP page. If the resulting variable is NOT = 0 then I assign a bit of text to a variable for inclusion in an email.
Ex.
------ Code Snippet -------
/ If osted variable is > 0, assign it to a printable variable /
if($aprnumber > "0"){
$varyapr = "----------------------------------
April 20$year
Total Tickets: $aprnumber
Average Open Time Per Ticket: $aprhours hours, $aprminutes minutes
----------------------------------";
};
mail("$EmailTo", "Time Report For 20$year","
$varyjan
$varyfeb
$varymar
$varyapr
$varymay
$varyjun\n","From: $Adminemail");
-------- End code snippet ---------
This actually works well for what I am doing. The problem is, I am assignin 15 printable variables, and when some of them are empty, the email is printed with a blank line in between each variable.
I want to remove the blank lines.
------- example: resulting email ------
This is the first printed variable
This is the second printed variable
This is the sixth printed variable
------- end example email --------------
Notice the blank lines in between the text.
Am I going in the right direction here?
How do I get rid of the blank lines?
I checked 'trim()' but didn't have much luck with that.
All ideas are welcome.