Page 1 of 1

how would I escape the quotes in CSS

Posted: Tue Apr 04, 2006 10:42 am
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

Posted: Tue Apr 04, 2006 10:43 am
by feyd
backslashes.

Posted: Tue Apr 04, 2006 10:43 am
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>';

Posted: Tue Apr 04, 2006 11:00 am
by bruceg
wonderful, thanks for the quick responses!