When using a simple string variable in an echo statement, should I:
- Format the string in the definition of the variable, or;
- Format the variable in the echo statement (which will ultimately display the value of the variable)?
In other words, should I use the below:
Code: Select all
$variable = "This is an example.";
echo "<h1>$variable</h1>Code: Select all
$variable = "<h1>This is an example.</h1>";
echo "$variable"Thank you in advance for any help.
-Matthew