Page 1 of 1

Third tier quotations?

Posted: Fri May 12, 2006 9:25 am
by Citizen

Code: Select all

echo "
<td style='vertical-align:bottom;'>

<div class='item2' onmouseover='this.className="item2"; onmouseout='this.className="item2";'>
<a href='$VAR[0]/arcade.php'>Random</a>
</div>

</td>
";
What do I do about "item2" when it is incased in a '?

Wont that end my echo command?

Posted: Fri May 12, 2006 9:30 am
by hawleyjr
You need to escape your double quotes. Also your variable won't parse the way you have it. you need to do something like this:

Code: Select all

echo "
<td style='vertical-align:bottom;'>

<div class='item2' onmouseover='this.className=\"item2\"; onmouseout='this.className=\"item2\";'>
<a href='" . $VAR[0] . "/arcade.php'>Random</a>
</div>

</td>
";

Posted: Fri May 12, 2006 9:38 am
by Citizen
Thanks a ton!

Also, I thought that you dont need to close and reopen the string to include a variable if you use " instead of ' when using the echo command.

Posted: Fri May 12, 2006 9:54 am
by hawleyjr
Citizen wrote:Thanks a ton!

Also, I thought that you dont need to close and reopen the string to include a variable if you use " instead of ' when using the echo command.
You don't. Just a (Good) habit :)