I need to do a triple embedding of quotes into PHP in order to execute a javascript command correctly and I was wondering if there was any way to do this.
For example, the thing I’m trying to triply embed is
echo ("<tr id='regular' onMouseOver='highlight($emp,$job,$cust,$lat,$lng)' onMouseOut='unhighlight()'>
<td>$emp</td>
<td>$job</td>
<td>$cust</td>
<td>$lat</td>
<td>$lng</td>
</tr>\n");
The thing is that I need to put in ‘$emp’, ‘$job’, and ‘$cust’, but whenever I put those in it ends the onMouseOver right after the first <td>.
You can’t really nest single quotes within single quotes that way. The easiest solution is to use escaped double quotes.