In addition to the repeated words in the string, the index string is generated. Get the index string ---------------------------------------------------------- functionGetIndexText ($ okstr, $ ilen-1) {if ($ okstr) return; $ wsexplod remove the duplicate in the string to generate the index
//--------------------------------------------------
Function GetIndexText ($ okstr, $ ilen =-1)
{
If ($ okstr = "") return "";
$ Ws = explode ("", $ okstr );
$ Okstr = "";
$ Wks = "";
Foreach ($ ws as $ w)
{
$ W = trim ($ w );
// Exclude characters smaller than 2
If (strlen ($ w) <2) continue;
// Exclude numbers or dates
If (! Ereg ("[^ 0-9:-]", $ w) continue;
If (strlen ($ w) = 2 & ord ($ w [0])> 0x80) continue;
If (isset ($ wks [$ w]) $ wks [$ w] ++;
Else $ wks [$ w] = 1;
}
If (is_array ($ wks ))
{
Arsort ($ wks );
If ($ ilen =-1)
{Foreach ($ wks as $ w =>v v) $ okstr. = $ w ."";}
Else
{
Foreach ($ wks as $ w =>v v ){
If (strlen ($ okstr) + strlen ($ w) + 1) <$ ilen) $ okstr. = $ w ."";
Else break;
}
}
}
Return trim ($ okstr );
}
Else // ------------------------------------------------ function GetIndexText ($ okstr, $ ilen =-1) {if ($ okstr =) return; $ ws = explod...