What is the issue with writing PHP variables in a .php file?

When writing PHP variables in a .php file, the issue arises when the PHP code is not enclosed within PHP opening and closing tags <?php and ?>. This can lead to syntax errors or unexpected output when the file is executed. To solve this issue, always make sure to enclose PHP code within <?php and ?> tags.

&lt;?php
$variable = &quot;Hello, World!&quot;;
echo $variable;
?&gt;