excel常用函数:PHP常用函数推荐来源: 发布时间:星期二, 2008年12月30日 浏览:35次 评论:0
这是
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() function random($length) { $hash = ''; $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'; $max = strlen($chars) - 1; mt_srand((double)microtime ![]() for($i = 0; $i < $length; $i ![]() $hash .= $chars[mt_rand(0, $max)]; } ![]() } 2.截取 ![]() ![]() ![]() 注:该 ![]() function wordscut($ ![]() ![]() ![]() ![]() $length=$length - 3; $addstr=' ...'; } for($i = 0; $i < $length; $i ![]() ![]() ![]() $wordscut .= $ ![]() ![]() $i ![]() } ![]() $wordscut .= $ ![]() } } ![]() } ![]() ![]() } 3.取得客户端IP地址 function GetIP ![]() ![]() ![]() $ip = getenv("HTTP_CLIENT_IP"); ![]() ![]() ![]() $ip = getenv("HTTP_X_FORWARDED_FOR"); ![]() ![]() ![]() $ip = getenv("REMOTE_ADDR"); ![]() ![]() ![]() ![]() $ip = $_SERVER['REMOTE_ADDR']; ![]() $ip = "unknown"; ![]() } 4.创建相应 ![]() function createdir($dir='') { ![]() { $temp = explode('/',$dir); $cur_dir = ''; for($i=0;$i<count($temp);$i ![]() { $cur_dir .= $temp[$i].'/'; ![]() { @mkdir($cur_dir,0777); } } } } 5.判断邮箱地址 function checkEmail($inAddress) { ![]() } 6.跳转 function gotourl($message='',$url='',$title='') { $html ="<html><head>"; ![]() $html .="<meta http-equiv='refresh' content=\"3;url='".$url."'\">"; $html .="<link href='../templates/style.css' type=text/css rel=stylesheet>"; $html .="</head><body><br><br><br><br>"; $html .="<table cellspacing='0' cellpadding='0' border='1' width='450' align='center'>"; $html .="<tr><td bgcolor='#ffffff'>"; $html .="<table border='1' cellspacing='1' cellpadding='4' width='100%'>"; $html .="<tr ![]() $html .="<td>".$title."</td></tr>"; $html .="<tr ![]() $html .="<br>".$message."<br><br>"; ![]() $html .="系统将在3秒后返回<br>如果您 ![]() ![]() $html .="[<a href='#' _disibledevent=最后页>最后页</a>"; ![]() } ?> 0
相关文章读者评论发表评论 |
|