<?php //随机小数 180it.com 搜集 function randomFloat($min = 0, $max = 1) { return '0.'.rand($min,$max); } ?>
<?php /** * 时间转化函数 180it.com 收集 * * @param $datetemp * @param $dstr * @return string */ function smartDate($datetemp, $dstr = 'Y-m-d H:i:s') { $op = ''; $sec = time() - $datetemp; $h...
<?php function generate_password( $length = 8 ) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; $password = ""; for ( $i = 0; $i < $length; $i+...
<?php function curl_request($url,$post='',$cookie='', $returnCookie=0,$ua='Mozilla/5.0 (compatible; sosospider/2.0; +http://www.soso.com/search/spider.html)',$referer='http://soso.com/'){ //cu...
<?php //Unescape解码 function utf8_urldecode($str) { $str = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($str)); return html_entity_decode($str,null,'UTF-8'...
<?php /** * 获取网络附件 * @param string $url 网络地址 * @param string $save_dir 保存目录 * @param string $filename 保存名称 * @param integer $type 下载类型1为curl下载 * @return array 返...
/** * 判断网址后否包含http || https * @param string $url 网址 * @return boolean 真返回真,假返回假 */ function is_http($url){ if(preg_match("/^(http:\/\/|https:\/\/).*$/",$url)){ retu...
/** * 密码字符集,可任意添加你需要的字符 * @param integer $length 需要的字符串长度 * @return string 返回随机字符串 */ function generate_password( $length = 8 ) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKL...
/** * 获取网站地址 * @return string 返回网站地址 */ function getWebUrl() { $http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &a...
<?php function getspider($useragent=''){ if(CC_Defender==2)return false; if(!$useragent){$useragent = $_SERVER['HTTP_USER_AGENT'];} $useragent=strtolower($useragent); if (strpos(...