Skip to content

Instantly share code, notes, and snippets.

@RRStoyanov
Created February 20, 2012 21:27
Show Gist options
  • Select an option

  • Save RRStoyanov/1871570 to your computer and use it in GitHub Desktop.

Select an option

Save RRStoyanov/1871570 to your computer and use it in GitHub Desktop.
fixTexts
public function fixTexts($string, $vid) {
$replace_find = array('–', '↑', '•', 'Ø', 'ß', 'Ö', 'Ü', 'Ä', '„', '“', '€', '×', '²', '″', '’', 'â€','€');
$replace_with = array('sss-dash-sss', 'sss-top-arrow-sss', 'sss-list-dot-sss', 'ss-rad-ss', 'ss-szlig-ss', 'ss-OOO-ss', 'ss-UUU-ss', 'ss-AAA-ss', 'ss-start-quote-ss', 'ss-end-quote-ss', 'ss-euro-ss', 'ss-xxx-ss', 'ss-sup-ss', 'ss-end-quote2-ss', 'ss-apostrophe-ss', 'ss-end-quote3-ss', 'ss-euro-ss');
$replace_with2 = array('–', '↑', '•', 'Ø', 'ß', 'Ö', 'Ü', 'Ä', '„', '“', '€', '×', '²', '″', '’', '”', '€');
$string = str_replace($replace_find, $replace_with, $string);
if (mb_check_encoding(utf8_decode($string), 'UTF-8') || in_array($vid, $this->forcedCoupons)) {
$string = utf8_decode($string);
}
$string = str_replace($replace_with, $replace_with2, $string);
return $string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment