Scenario: I need to replace Microsoft Word version of single and double quotations marks (“ ” ‘ ’) with regular quotes (' and ") due to an encoding issue in my application.
$search = array(
chr(145),
chr(146),
chr(147),
chr(148),
chr(151)
);
$replace = array(
"'",
"'",
'"',
'"',
'-'
);
return str_replace($search, $replace, $value);
Reference: http://stackoverflow.com/a/1262060/345721
$search = array(
chr(145),
chr(146),
chr(147),
chr(148),
chr(151)
);
$replace = array(
"'",
"'",
'"',
'"',
'-'
);
return str_replace($search, $replace, $value);
No comments:
Post a Comment