how would I escape the quotes in CSS

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bruceg
Forum Contributor
Posts: 174
Joined: Wed Mar 16, 2005 11:07 am
Location: Morrisville, NC
Contact:

how would I escape the quotes in CSS

Post by bruceg »

I need to escape the class="home" for in the CSS declaration in between my PHP code as listed below.

Code: Select all

else {
 $visit_count=$_SESSION['visit_count'] +1;
 echo "<h3 class="home">Welcome Back!  I see you have visited $visit_count times</h3>";
and can't remember how it's done. I thought it was <h3 class='"home"'>, but that doesn't work.

please assist
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

backslashes.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Code: Select all

echo "<h3 class=\"home\">Welcome Back!  I see you have visited $visit_count times</h3>";
or

Code: Select all

echo '<h3 class="home">Welcome Back!  I see you have visited '.$visit_count times.'</h3>';
bruceg
Forum Contributor
Posts: 174
Joined: Wed Mar 16, 2005 11:07 am
Location: Morrisville, NC
Contact:

Post by bruceg »

wonderful, thanks for the quick responses!
Post Reply