PHP quotes inside quotes

According to php.net

To specify a literal single quote, escape it with a backslash (\). 

It means you could have:

<?php
  echo '<span onclick="$(this).addClass(\'selected\');"> </span>';
?>

Leave a Comment