PHP 带变量的字符串
PHP string with variable
如何在通知电子邮件的主题中添加带有变量的字符串?我想将 api 中的数据添加到主题电子邮件中,但不确定如何将其与中间的字符串消息一起传递以形成一个句子。
我要这条消息
`$subject = 'Hi:' $filmName 'is part of your suggestions'`
或
$subject = 'Hi:' $fullName, 'the film' $filmName, 'has been recommended'
然后我可以用 toMail
方法
中的主题来做这个
return (new MailMessage())
->subject($subject)
试试这个 -
$subject = 'Hi: '.$fullName.', the film '.$filmName.', has been recommended';
如何在通知电子邮件的主题中添加带有变量的字符串?我想将 api 中的数据添加到主题电子邮件中,但不确定如何将其与中间的字符串消息一起传递以形成一个句子。
我要这条消息
`$subject = 'Hi:' $filmName 'is part of your suggestions'`
或
$subject = 'Hi:' $fullName, 'the film' $filmName, 'has been recommended'
然后我可以用 toMail
方法
return (new MailMessage())
->subject($subject)
试试这个 -
$subject = 'Hi: '.$fullName.', the film '.$filmName.', has been recommended';