What are the limitations of HTML in handling variables compared to PHP?

HTML is a static markup language and cannot handle variables or perform logic like PHP. To overcome this limitation, you can use PHP to dynamically generate HTML content based on variables. By embedding PHP code within HTML, you can easily manipulate variables and create dynamic web pages.

<?php
$variable = "Hello, World!";
?>
<!DOCTYPE html>
<html>
<head>
    <title>PHP Variable Example</title>
</head>
<body>
    <h1><?php echo $variable; ?></h1>
</body>
</html>