PHP nl2br() basic function

后端 未结 3 1698
一个人的身影
一个人的身影 2020-12-10 09:56

Can somebody please help me with this mail script.

I\'m simply trying to send an html email and part of the message is from a user textarea, which puts in \\r\\n.

3条回答
  •  渐次进展
    2020-12-10 10:34

    This string contains embedded newlines so you'll end up with a few unwanted
    s.

    $message = nl2br("
        
    $message_var_1
    ");

    You can:

    $message = "
    " . nl2br($message_var_1) . "
    ";

    Or, its much easier to use a

     tag:

    $message = "
    $message_var_1
    ";

提交回复
热议问题