Quotes within Quotes

Hello,

I’m using PHP to pull multiple choice questions and solutions from my database. It works great except if one of the solutions happens to have quotes in it (see attached screen shot, last multiple choice entry). My code for a given solution (I loop through 4 times) is given by:

//my input is coming from TINYMCE which automatically puts opening and closing <p> tags; this step gets rid of them
$printed_solution = RemoveParagraphs($current_solution)?>
    <label> 
<input type ="radio" name="solution" id="solution" value=" <?php echo addslashes($current_solution) ?>"
<?php if (($submitted_solution) && ($submitted_solution == $current_solution)) {echo 'checked = "yes"';} ?>/>
<?php echo $printed_solution;?></label><br /> 
//I thought that using addslashes would get rid of any quote issues....

This code generates the following source code on my web page:

<input type ="radio" name="solution" id="solution" value=" <p>A letter u pointing to the left.</p>"/>A letter u pointing to the left.</label><br />    <label>
			  <input type ="radio" name="solution" id="solution" value=" <p>An upside down letter u.</p>"/>An upside down letter u.</label><br />    <label>
			  <input type ="radio" name="solution" id="solution" value=" <p>A letter u &nbsp;pointing to the right.</p>"/>A letter u &nbsp;pointing to the right.</label><br />    <label>
			  <input type ="radio" name="solution" id="solution" value=" <p>A right-side up letter \\"u\\".</p>"/>A right-side up letter "u".</label><br /></p>

I’ve also attached a screen shot of the problem. If anyone has some insight, I’d appreciate the help.

Thanks!

-Eric

Use htmlentities() or do a str_replace() - replace quotes with "

Thanks so much!

-Eric