I'm trying to include a string variable as the title to an anchor tag, so when the user hovers over the link, they see the text. The text may or may not include single or double quotes and comes from a mysql table column.
Here is the code:
echo '<a title="'.$classRow['Description'].'">'.$classRow['LongName'].'</a>';
The above code works correctly if $classRow['Description']
is:
In this class, we'll watch a movie.
But the title is truncated after the word 'movie ' if $classRow['Description']
is:
In this class, we'll watch the movie "Life of Pi."
I tried using addslashes($classRow['Description']) but that just displays the slash; the text is still truncated once it reaches the double quote.