Sabha Sabha - 4 months ago 20
PHP Question

Adding a html message

I am getting

Parse error: syntax error, unexpected 'text' (T_STRING) in /home/xxx/public_html/sample.php on line 243


line 243 is the one with
<h1>
tag

$message = "
<h1 style="text-align:center;color:blue;">Congratulations !</h1>
";


I dont see anything wrong in this. Can someone help?

Answer

Use single quote inside style attribute:

$message = "<h1 style='text-align:center;color:blue;'>Congratulations !</h1>";
Comments