亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

php形式的字符之間的空格

php形式的字符之間的空格

PHP
GCT1015 2023-04-02 10:32:12
<?php        ini_set( display_errors, 1 );        error_reporting( E_ALL );        $email = $_POST['myEmail'];        $name = $_POST['myName'];        $news = $_POST['news'];        if($news != 'Yes')         $news = 'No';          $to = "[email protected]";        $subject = "Add me to the Launch Day Notification List!";        $headers = "From:".$email;        $txt = "This person wishes to be added to the launch day notification list".$name <br>        "Does this person wish to subscribe to the newsletter?".$news;        mail($to,$subject,$headers,$txt);        echo "Thank you for your inquiry, you will be added to our launch day notification list!";?> 我的問題出在 $txt 部分,我想在 $name 和 $news 以及句子的最后一個字符之間留出空格。而且,我如何在兩個問題之間添加一個中斷,以便它們輸出如下:此人希望被添加到發布日通知列表中:在此填寫姓名 此人是否希望訂閱時事通訊?是或否在這里
查看完整描述

1 回答

?
繁星點點滴滴

TA貢獻1803條經驗 獲得超3個贊

只需像這樣添加一個空格

$txt = "This person wishes to be added to the launch day notification list $name<br>Does this person wish to subscribe to the newsletter? $news";

如果您不發送 HTML 電子郵件,則應將其替換為<br>類似"\n"

$txt = "This person wishes to be added to the launch day notification list $name\nDoes this person wish to subscribe to the newsletter? $news";


查看完整回答
反對 回復 2023-04-02
  • 1 回答
  • 0 關注
  • 141 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號