$message .= "
    <html>
        <head>
        <title>Copy of your form submission</title>
        </head>
        <body>
            <table>
                <tr>
                    <td>
                     "<img src="images/assets/thank_you.png" alt="Thank You" />"
                    </td>
                </tr>
            </table>
        </div>
    </html>
";

如果我写信
$message.=上面的图像链接相同;
它起作用了。但是,当我像上面那样将图像标记写入html时,就不能工作了。有人能帮忙吗?

最佳答案

不需要在"标记周围使用引号img。在使用的双引号中也使用单引号'。如下所示:

$message .= "
    <html>
        <head>
        <title>Copy of your form submission</title>
        </head>
        <body>
            <table>
                <tr>
                    <td>
                     <img src='images/assets/thank_you.png' alt = 'Thank You' />
                    </td>
                </tr>
            </table>
        </div>
    </html>";

关于php - 如果我在该图像中写入另一个变量,则图像标记在php html中不起作用。请在下面找到随附的代码,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52092730/

10-10 01:17
查看更多