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