一尘不染

PHP电子邮件中的新换行符

php

我有以下代码:

$message = "Good news! The item# $item_number on which you placed a bid of \$ $bid_price is now available for purchase at your bid price.\n
The seller, $bid_user is making this offer.\n
\nItem Title : $title\n

\nAll the best,\n
$bid_user\n
$email\n
";

echo $message;
$htmlContent = $baseClass->email_friend($item_number, $title, $bid_price, $bid_user, $mcat, $message, $email, $VIEWSTATE, $EVENTVALIDATION, $URL);

问题是 新的换行符 (\n)不起作用。


阅读 394

收藏
2020-05-29

共1个答案

一尘不染

尝试\r\n代替\n

\ n和\ r \ n之间的区别

应当注意,这适用于电子邮件中的行退回。

2020-05-29