N
N
nyrau_v_tvorojok2021-01-17 08:35:11
PHP
nyrau_v_tvorojok, 2021-01-17 08:35:11

Problem with writing?

$mail->Body    = '<div style="text-align: center;">
                          <h2>${name}</h2>
                          <p>Отправил заявку с сайта!</p>
                          <p>Его данные:</p>
                          <h4>$email</h4>
                          <h4>$phone</h4>
                          </div>';



${name}
Submitted a request from the site!

His data:

$email
$phone


how to put a variable in the code?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fallenyasha, 2021-01-17
@Fallenyasha

$mail->Body    = "<div style=\"text-align: center;\">
                          <h2>{$name}</h2>
                          <p>Отправил заявку с сайта!</p>
                          <p>Его данные:</p>
                          <h4>{$email}</h4>
                          <h4>{$phone}</h4>
                          </div>";

A
Anastasia, 2021-01-20
@nastya97core

the man above answered so wonderfully that nothing was clear.
You need to use not single quotes around the edges ' - but double "
inside instead of these GENIUS constructions with \" - use single ones
, but what for he put curly braces - it still remains a mystery to me

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question