How can a variable be passed to an HTML text field in PHP for display?

To pass a variable to an HTML text field in PHP for display, you can use the `value` attribute of the input field. By setting the `value` attribute to the variable you want to display, the text field will be pre-filled with the variable's value when the page is loaded.

<?php
$variable = "Hello, World!";
?>
<input type="text" name="textfield" value="<?php echo $variable; ?>">