commit | author | age | ||
ced309 | 1 | <?php |
JK | 2 | setlocale(LC_CTYPE, 'pl_PL.UTF-8'); |
3 | ||
4 | function split_stop_name($string) { | |
5 | $string = strtolower(iconv('utf-8', 'ascii//TRANSLIT', $string)); | |
6 | $words = preg_split('/\\W+/', $string); | |
7 | ||
8 | foreach($words as &$word) { | |
9 | $two = substr($word, 0, 2); | |
10 | if($two == 'os') $word = 'os'; | |
11 | elseif($two == 'al') $word = 'al'; | |
12 | elseif($two == 'sw') $word = 'sw'; | |
13 | } | |
14 | unset($word); | |
15 | ||
16 | return $words; | |
17 | } |