Try using the php function addslashes:
<?php
$str = "Is your name O'reilly?";
// Outputs: Is your name O\'reilly?
echo addslashes($str);
?>
So for EE you could have something like:
<p>This is the title and excerpt of this entry: "
<?php
$str = "<strong>". addslashes({title}) . "</strong> : ";
$str .= addslashes({post_excerpt}); // combine title and post_excerpt
echo stripslashes($str); // remove the slashes.
?>
"</p>