我有以下代码:
$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)不起作用。
(\n)
尝试\r\n代替\n
\r\n
\n
\ n和\ r \ n之间的区别
应当注意,这适用于电子邮件中的行退回。