-
Notifications
You must be signed in to change notification settings - Fork 0
/
SubIndex.php
29 lines (28 loc) · 860 Bytes
/
SubIndex.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
function GetIndex($title)
{
$s1 = utf8_decode($title);
$s1 = strtr ($s1, 'ÄäÖöÜüß', 'AaOoUuS');
$s1 = strtoupper($s1);
$worte=explode(" ",$s1);
if ((strcasecmp($worte[0], "ein" ) == 0) ||
(strcasecmp($worte[0], "eine") == 0) ||
(strcasecmp($worte[0], "der" ) == 0) ||
(strcasecmp($worte[0], "die" ) == 0) ||
(strcasecmp($worte[0], "das" ) == 0) ||
(strcasecmp($worte[0], "the" ) == 0) ||
(strcasecmp($worte[0], "a" ) == 0) ||
(strcasecmp($worte[0], "an" ) == 0) ||
(strcasecmp($worte[0], "el" ) == 0) ||
(strcasecmp($worte[0], "la" ) == 0))
{
array_shift($worte); // erstes Wort wech
}
$c1 = substr($worte[0],0,1);
if (ctype_digit($c1)) array_unshift($worte, '#');
elseif (ctype_alpha($c1)) array_unshift ($worte, $c1);
else array_unshift($worte, '*');
$s1 = implode(" ",$worte);
return $s1;
}
?>