Is it possible to put quotes inside quotes?
If so how?
Here is my code:
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>';
?>
Heredoc is the perfect solution for this:
<?php
echo <<< HereDocString
<span onclick="$(this).addClass('selected');"> </span>
HereDocString;
?>
You could do this:
<?php
// some code
?>
<span onclick="$(this).addClass('selected');"> </span>
<?php
// some more code.
?>