What is the best practice for embedding PHP variables in HTML blocks stored in a variable?

When embedding PHP variables in HTML blocks stored in a variable, the best practice is to use double quotes for the HTML block and concatenate the PHP variables within the block using the dot (.) operator. This ensures that the PHP variables are properly parsed and replaced with their values when the HTML block is output.

<?php
// Example of embedding PHP variables in HTML blocks stored in a variable
$name = "John Doe";
$age = 30;

$htmlBlock = "<p>Hello, my name is " . $name . " and I am " . $age . " years old.</p>";

echo $htmlBlock;
?>