Func. php3
The Code is as follows:
<? Php
Function suiji ($ max)
{
Srand (double) microtime () * 1000000 );
$ X = rand ();
$ Y = getrandmax ();
$ R = $ x/$ y * ($ max-1 );
$ R = round ($ r ++ );
Return $ r;
}
Function StrOccurs ($ sStr, $ sFind ){
$ STemp = $ sStr;
$ ILen = strlen ($ sFind );
$ ICount = 0;
While (true ){
If (strstr ($ sTemp, $ sFind ))
Break;
Else
$ STemp = instr ($ sTemp, strpos ($ sTemp, $ sFind) + $ iLen );
$ ICount ++;
}
}
Return $ iCount;
}
Function StrDupl ($ sStr, $ iCnt ){
$ Ret = "";
For ($ I = 1; $ I <= $ iCnt; $ I ++)
$ Ret. = $ sStr;
Return $ ret;
}
Function DelQuot ($ sStr ){
$ S = str_replace (chr (124), "success", $ sStr );
$ S = str_replace (chr (39), "'", $ s );
$ S = str_replace (chr (34), "", $ s );
Return s;
}
Function DelTag ($ sStr ){
$ BNeed = "False ";
$ SOther = strtoupper ($ sStr );
If ($ bNeed! = "True" |! Strstr ($ sOther, "<TABLE") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</TABLE") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<SCRIPT") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</SCRIPT") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<BODY") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</BODY") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<HTML") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</HTML") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<HEAD") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</HEAD") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<FORM") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</FORM") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<INPUT") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</INPUT") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<OPTION") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</OPTION") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<SELECT") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</SELECT") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<APPLET") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</APPLET") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<OBJECT") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</OBJECT") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<MENU") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</MENU") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<FRAMESET") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</FRAMESET") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<FRAME") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</FRAME") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<IFRAME") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</IFRAME") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<STYLE") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "</STYLE") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "<BASE") $ bNeed = "True ";
If ($ bNeed! = "True" |! Strstr ($ sOther, "FONT-SIZE:") $ bNeed = "True ";
If ($ bNeed = "True ")
Return str_replace (">", ">", str_replace ("<", "<", $ sStr ));
Else
Return $ sStr;
}
Function AddLost ($ sStr ){
$ Ret = $ sStr;
$ Ret. = StrDupl (">", (StrOccurs (strtoupper ($ ret), "<")-StrOccurs (strtoupper ($ ret), "> ")));
$ Ret. = StrDupl ("</FONT>", (StrOccurs (strtoupper ($ ret), "<FONT")-StrOccurs (strtoupper ($ ret ), "</FONT> ")));
$ Ret. = StrDupl ("</B>", (StrOccurs (strtoupper ($ ret), "<B")-StrOccurs (strtoupper ($ ret ), "</B> ")));
$ Ret. = StrDupl ("</I>", (StrOccurs (strtoupper ($ ret), "<I")-StrOccurs (strtoupper ($ ret ), "</I> ")));
$ Ret. = StrDupl ("</U>", (StrOccurs (strtoupper ($ ret), "<U")-StrOccurs (strtoupper ($ ret ), "</U> ")));
$ Ret. = StrDupl ("</S>", (StrOccurs (strtoupper ($ ret), "<S")-StrOccurs (strtoupper ($ ret ), "</S> ")));
$ Ret. = StrDupl ("</STRIKE>", (StrOccurs (strtoupper ($ ret), "<STRIKE")-StrOccurs (strtoupper ($ ret ), "</STRIKE> ")));
$ Ret. = StrDupl ("</STRONG>", (StrOccurs (strtoupper ($ ret), "<STRONG")-StrOccurs (strtoupper ($ ret ), "</STRONG> ")));
$ Ret. = StrDupl ("</SMALL>", (StrOccurs (strtoupper ($ ret), "<SMALL")-StrOccurs (strtoupper ($ ret ), "</SMALL> ")));
$ Ret. = StrDupl ("</CITE>", (StrOccurs (strtoupper ($ ret), "<CITE")-StrOccurs (strtoupper ($ ret ), "</CITE> ")));
$ Ret. = StrDupl ("</EM>", (StrOccurs (strtoupper ($ ret), "<EM")-StrOccurs (strtoupper ($ ret ), "</EM> ")));
$ Ret. = StrDupl ("</CODE>", (StrOccurs (strtoupper ($ ret), "<CODE")-StrOccurs (strtoupper ($ ret ), "</CODE> ")));
$ Ret. = StrDupl ("</SAMP>", (StrOccurs (strtoupper ($ ret), "<SAMP")-StrOccurs (strtoupper ($ ret ), "</SAMP> ")));
$ Ret. = StrDupl ("</KBD>", (StrOccurs (strtoupper ($ ret), "<KBD")-StrOccurs (strtoupper ($ ret ), "</KBD> ")));
$ Ret. = StrDupl ("</VAR>", (StrOccurs (strtoupper ($ ret), "<VAR")-StrOccurs (strtoupper ($ ret ), "</VAR> ")));
$ Ret. = StrDupl ("</DFN>", (StrOccurs (strtoupper ($ ret), "<DFN")-StrOccurs (strtoupper ($ ret ), "</DFN> ")));
$ Ret. = StrDupl ("</BIG>", (StrOccurs (strtoupper ($ ret), "<BIG")-StrOccurs (strtoupper ($ ret ), "</BIG> ")));
$ Ret. = StrDupl ("</SUP>", (StrOccurs (strtoupper ($ ret), "<SUP")-StrOccurs (strtoupper ($ ret ), "</SUP> ")));
$ Ret. = StrDupl ("</SUB>", (StrOccurs (strtoupper ($ ret), "<SUB")-StrOccurs (strtoupper ($ ret ), "</SUB> ")));
$ Ret. = StrDupl ("</H1>", (StrOccurs (strtoupper ($ ret), "<H1")-StrOccurs (strtoupper ($ ret ), "</H1> ")));
$ Ret. = StrDupl ("</H2>", (StrOccurs (strtoupper ($ ret), "<H2")-StrOccurs (strtoupper ($ ret ), "</H2> ")));
$ Ret. = StrDupl ("</H3>", (StrOccurs (strtoupper ($ ret), "<H3")-StrOccurs (strtoupper ($ ret ), "</H3> ")));
$ Ret. = StrDupl ("</H4>", (StrOccurs (strtoupper ($ ret), "<H4")-StrOccurs (strtoupper ($ ret ), "</H4> ")));
$ Ret. = StrDupl ("</H5>", (StrOccurs (strtoupper ($ ret), "<H5")-StrOccurs (strtoupper ($ ret ), "</H5> ")));
$ Ret. = StrDupl ("</H6>", (StrOccurs (strtoupper ($ ret), "<H6")-StrOccurs (strtoupper ($ ret ), "</H6> ")));
$ Ret. = StrDupl ("</H7>", (StrOccurs (strtoupper ($ ret), "<H7")-StrOccurs (strtoupper ($ ret ), "</H7> ")));
Return $ ret;
}
?>
[This article is copyrighted by the author and osuo. If you need to reprint it, please indicate the author and its source]