function curl_me($curlme) { // This should take care of the single quotes $curlme = preg_replace("/'([dmst])([ .,?!\)\/<])/i","’$1$2",$curlme); $curlme = preg_replace("/'([lrv])([el])([ .,?!\)\/<])/i","’$1$2$3",$curlme); $curlme = preg_replace("/(?\s+)'((?:[^ >])?(?:.*?)(?:[^=]))'(\s*[^>&])/Ss","$1‘$2’$3",$curlme); // time for the doubles $curlme = preg_replace('/(?]])((?:.*?)(?:[^=])?)"(\s*[^>&])/Ss',"$1“$2”$3",$curlme); // multi-paragraph $curlme = preg_replace('/"(.*)<\/p>/U
',"“$1
",$curlme); // not a quote, but whatever $curlme = str_replace('Ñ','—',$curlme); $curlme = str_replace('Ð','–',$curlme); return $curlme; }