<?
//去除特殊字符的函数,目的是生成URL
echo “输入: “.$_REQUEST[“myfilename”].”<br><br>”;
$myfilename=strtolower(str_replace(” “,”-“,trim($_REQUEST[“myfilename”])));
$myarp=array(‘.’,’+’,’,’,’,’,’。’,’%’,’&’,’*’,’/’,’\\’,’|’,’=’,'(‘,’)’,’^’,’$’,’#’,’@’,’!’,’~’,’`’,’/’,’;’,’:’,'”‘,'[‘,’]’,'{‘,’}’,’>’,'<‘);
for($i=0;$i<=count($myarp);$i++)
{$myfilename=str_replace($myarp[$i],””,$myfilename);
}

echo “输出: “. $myfilename.”<br><br>”;
?>


寒林

www.3code.cn 专注WordPress企业主题