0

I'm getting a parse error, can anyone please advise what I'm missing:

Error on browser is :

Parse error: syntax error, unexpected 'Content' (T_STRING) in /path/coder.php on line 8

Line 8 is :

$stringData = "<meta http-equiv="Content-Type" content="text/html; charset=utf-8">;\n";
Rizier123
  • 58,877
  • 16
  • 101
  • 156
yardyy
  • 89
  • 8
  • @rizier123 I think it is because of the double quotes that i have in the line.. but i need them as part of the html code.. so not sure how to add the complete line – yardyy Mar 23 '15 at 19:49
  • Yes! It's because of the double quotes. Now you have 2 options to solve this where some are more elegant than the others. 1. Change the inner double quotes to single quotes e.g. `$stringData = ";\n";` 2. Escape the inner double quotes e.g. `$stringData = ";\n";` – Rizier123 Mar 23 '15 at 19:52
  • @Rizier123 Thanks for that nugget of knowledge.. I have tested that and used both suggestions, and it has worked a treat.. Many Thanks Again. – yardyy Mar 25 '15 at 09:47

0 Answers0