What are the potential issues with embedding PHP functions within HTML tags?

Embedding PHP functions within HTML tags can make the code harder to read and maintain. It can also lead to potential security vulnerabilities if user input is not properly sanitized. To solve this issue, it's recommended to separate PHP logic from HTML presentation by using PHP to generate dynamic content and then outputting it within HTML tags.

<?php
// Separate PHP logic from HTML presentation
$name = "John";

// Use PHP to generate dynamic content
$greeting = "Hello, " . $name . "!";

// Output the dynamic content within HTML tags
?>
<!DOCTYPE html>
<html>
<head>
    <title>Greeting Example</title>
</head>
<body>
    <h1><?php echo $greeting; ?></h1>
</body>
</html>