用PHP和ACCESS写聊天室(十)_php基础
程序员文章站
2024-01-14 15:13:40
...
func.php3
代码如下:
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 $ret.=$sStr;
return $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,"
")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther,"FONT-SIZE:")) $bNeed="True";
if ($bNeed=="True")
return str_replace(">",">",str_replace(" else
return $sStr;
}
function AddLost($sStr){
$ret=$sStr;
$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), "
代码如下:
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 $ret.=$sStr;
return $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,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther," if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
if ($bNeed!="True" || !strstr($sOther,"
if ($bNeed=="True")
return str_replace(">",">",str_replace(" else
return $sStr;
}
function AddLost($sStr){
$ret=$sStr;
$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), "")));
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")));
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")));
$ret.=StrDupl("", (StrOccurs(strtoupper($ret), "")));
return $ret;
}
?>
【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】
上一篇: PHP消息提醒数据表