Reputation: 159
I'm using the php mail function and trying to insert variables into my email messages. Here is some sample code that's similar to what I'm doing
<?php
$name = "franklin";
$message = "blah blah blah".$name.".";
?>
$name is coming from a csv file.
The problem is that the period after $name is being bumped to the next line, so the message looks like this:
blah blah blah franklin
. <--period is here
Is there any way to stop this from happening?
Upvotes: 2
Views: 178
Reputation: 784898
Try trim function like this:
$message = "blah blah blah". trim($name) . ".";
Your variable $name
might have EOL
as the last character thus bumping period after that to next line.
Upvotes: 3