melanie74 wrote:What if the data is already in the database with the single or double quote in the measurement? How can I get it to display properly?
If the data is already in the database correctly, simply use the
<?php echo htmlentities($description, ENT_QUOTES); ?>
to display the information. That encodes the ' and " into HTML escaped/encoded format for proper display.
From: http://www.php.net/manual/en/function.htmlentities.php
<?php
$str = "A 'quote' is <b>bold</b>";
// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($str, ENT_QUOTES);
?>
--Edit: You'll need to visit the link above to see the actual output, since the forum software is converting the quotes from the code...