| 1519 | | $reserved_words = array('atom', 'last'); |
|---|
| 1520 | | $words = explode(' ', $string); |
|---|
| 1521 | | $string = ''; |
|---|
| 1522 | | |
|---|
| 1523 | | foreach ($words as $word) |
|---|
| 1524 | | { |
|---|
| 1525 | | if (strlen($word) > 3 && !in_array(strtolower($word), $reserved_words)) |
|---|
| 1526 | | $string .= '-'.$word; |
|---|
| 1527 | | } |
|---|
| 1528 | | |
|---|
| 1529 | | $string = urlencode(strtr(str_replace('?', '', utf8_decode($string)), utf8_decode('ÃÃÃÃÃÃ |
|---|
| 1530 | | à áâãÀåÃÃÃÃÃÃòóÎõöÞÃÃÃÃÚéêëÃçÃÃÃÃìÃîïÃÃÃÃùúûÌÿÃñ/'), 'AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn-')); |
|---|
| 1531 | | |
|---|
| 1532 | | return $string; |
|---|
| | 1519 | $str = strtolower(utf8_decode($str)); |
|---|
| | 1520 | $str = strtr($str, |
|---|
| | 1521 | "\xc0\xc1\xc2\xc3\xc4\xc5\xe0\xe1\xe2\xe3\xe4\xe5\xd2\xd3\xd4\xd5\xd6\xd8\xf2\xf3\xf4\xf5\xf6\xf8\xc8\xc9\xca\xcb\xe8\xe9\xea\xeb\xc7\xe7\xcc\xcd\xce\xcf\xec\xed\xee\xef\xd9\xda\xdb\xdc\xf9\xfa\xfb\xfc\xff\xd1\xf1", |
|---|
| | 1522 | 'aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn' |
|---|
| | 1523 | ); |
|---|
| | 1524 | $str = preg_replace(array('/[^a-z0-9\s]/', '/[\s]+/'), array('', '-'), $str); |
|---|
| | 1525 | |
|---|
| | 1526 | return $str != '-' ? '-'.trim($str, '-') : ''; |
|---|