What potential issues can arise when trying to display a variable in PHP?

One potential issue when trying to display a variable in PHP is if the variable is not properly concatenated within a string. This can result in errors or unexpected output. To solve this issue, make sure to properly concatenate the variable within the string using the "." operator.

// Incorrect way of displaying a variable within a string
$variable = "World";
echo "Hello $variable"; // This may not work as expected

// Correct way of displaying a variable within a string
$variable = "World";
echo "Hello " . $variable; // This will display "Hello World"