This question has already been answered:
How to insert a variable between p tags
$message = ' <html> <head> <title></title> </head> <body> <p>Например тут</p> </body> </html>'; This question has already been answered:
How to insert a variable between p tags
$message = ' <html> <head> <title></title> </head> <body> <p>Например тут</p> </body> </html>'; PHP executes code inside delimiters, such as
<?php ?>. All that is outside the limiters, is displayed without changes. This is mainly used to insert PHP code into an HTML document ...
Proper use of PHP in context with HTML markup
<html> <head> <title><?php echo $title; ?></title> </head> <body> <p><?php echo $myVar; ?></p> </body> </html> That's right, and it will be more convenient for you in the future if you organize the structure of your project as follows: insert the script into the HTML markup, and not PHP output the markup (unless of course it is generated from something).
These are the basics of syntax.
If you later want to use any template engine, it will also be easier for you.
Additional Information
Still there is such an option, more concise, in my opinion
<html> <head> <title><?=$title?></title> </head> <body> <p><?=$myVar?></p> </body> </html> Source: https://ru.stackoverflow.com/questions/704478/
All Articles
Например тутon'.$xyz.'- Visman{$var}- DaemonHK