Replace MS Word single quotes in PHP

Replace MS Word single quotes in PHP:

Replace MS Word single quotes in PHP

 The following function is used to replace Microsoft-encoded quotes in PHP.

function replaeQuotes($str) 

    $str1 = array(chr(145),chr(146), chr(147), chr(148), chr(151)); 
    $str2 = array(“‘”, “‘”,'”‘,'”‘,’-‘); 
    return str_replace($str1, $str2, $str); 
}

For Ex:

In php,

 $str=”‘This is TechniqZone’-For Developers”;
$clearStr=replaeQuotes($str);

Leave a Reply

Your email address will not be published. Required fields are marked *