What is the correct syntax for embedding PHP code within HTML for text alignment?

When embedding PHP code within HTML for text alignment, you can use the PHP echo statement to output HTML code that includes text alignment properties. To align text in HTML using PHP, you can use inline styles or CSS classes to set the alignment. This allows you to dynamically adjust text alignment based on conditions or variables in your PHP code.

<?php
$alignment = "center"; // Set the alignment dynamically based on conditions
echo "<p style='text-align: $alignment;'>Text aligned in the center</p>";
?>