What is the syntax in PHP to concatenate a variable with a string for text field input?

To concatenate a variable with a string for text field input in PHP, you can use the period (.) operator to combine the variable and the string. This allows you to dynamically insert the variable value into the string. Example:

$name = "John";
echo '<input type="text" name="username" value="' . $name . '">';