function tweet_feed_filter_smart_quotes in Tweet Feed 7.3
Same name and namespace in other branches
- 8.3 tweet_feed.module \tweet_feed_filter_smart_quotes()
- 4.x tweet_feed.module \tweet_feed_filter_smart_quotes()
Filter smart quotes to ASCII equivalent.
Parameters
string $text: Input text to filter.
Return value
string
1 call to tweet_feed_filter_smart_quotes()
- tweet_feed_save_tweet in ./
tweet_feed.module - Save The Tweet (and profile)
File
- ./
tweet_feed.module, line 1170
Code
function tweet_feed_filter_smart_quotes($text) {
// Convert varieties of smart quotes to ACSII equivalent.
$search = array(
chr(0xe2) . chr(0x80) . chr(0x98),
chr(0xe2) . chr(0x80) . chr(0x99),
chr(0xe2) . chr(0x80) . chr(0x9c),
chr(0xe2) . chr(0x80) . chr(0x9d),
chr(0xe2) . chr(0x80) . chr(0x93),
chr(0xe2) . chr(0x80) . chr(0x94),
);
$ascii_replace = array(
"'",
"'",
'"',
'"',
'-',
'—',
);
return str_replace($search, $ascii_replace, $text);
}