Simple. Inside HTML text (ie. src="..") double quotes are used to identify text.
With PHP you have 2 options to enclose something:
- Single quotes: No evaluation of the content takes place
- Double quotes: Content is evaluated (ie. variables and such)
If you use double quotes inside a text, and you enclose the text with double quotes, then PHP will not know where the text starts and where it ends. It will read the first double quote as start en the 2nd (ie. the one embedded in the text) as closing quote. To avoid this enclose text that has a double-quote inside by single quotes. Alternative would be to escape special characters like the doube-quote with the escape character \.
|