ホームページ >php教程 >php手册 >PHP と ACCESS を使用してチャット ルームを作成する (10)

PHP と ACCESS を使用してチャット ルームを作成する (10)

WBOY
WBOYオリジナル
2016-06-21 09:03:09878ブラウズ
func.php3
代码如下:
function suiji($max)
{
srand((double)microtime()*1000000);
$x=rand();
$y=getrandmax();
$r=$x/$y*($max-1);
$r=round($r++);
$r を返します。
}

関数 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++;
}
}
$iCount を返す;
}

関数 StrDupl($sStr, $iCnt){
$ret="";
for($i=1;$i<=$iCnt;$i++)
$ret.=$sStr;
$ret を返す;
}

function DelQuot($sStr){
$s=str_replace(chr(124),"|",$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," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || ! strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther,"        if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther," 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("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
        $ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")));
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "

$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")) );
$right を返します。
}
?>



声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。