//在线人数 function online_users() { $filename='online.txt'; $CookieName='OnLinePerson'; $onlineTime=30; $online=file($filename); $nowtime=$_SERVER['REQUEST_TIME']; $nowonline=array(); foreach($online as $line){ $row=explode('|',$line); $sesstime=tr...
function check_content($content) { $content_reg='/正则表达式/i'; if ( preg_match($content_reg,$content) ) { return true; } //结果不符合格式,也当失败处理 else { return false; } } //调用 if ( check_content($content)===true ) { } //API接口没有响应 else { echo 'API connec...
/* API的签名生成 说明: 1、规则:md5(id:key:域名) 传入: $id 客户id号 $key API的key字符串 $domain 被查询网址提取的域名 返回 md5 32位字符串 */ function create_sign ($id,$key,$domain) { return md5("{$id}:{$key}:{$domain}"); }
/* 提取被查询网址的域名 说明: 1、提取后的域名不带http:// 2、不支持ip形式 传入:被查询的网址 返回:域名字符串 */ function get_domain ($site) { $domain=''; if ( preg_match('!^(?:http://|https://)?((?:[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,16})(?:$|\W)!', $site, $temp) ) { $domain=$temp[1]; } //返回...
在php中有两个函数——至少有两个是否有其他的我还不知道,能够实现数字补零,str_pad(),sprintf()详细如下str_pad顾名思义这个函数是针对字符串来说的这个可以对指定的字符串填补任何其它的字符串例如:str_pad(带填补的字符串,填补后的长度,填补字符串,填补位置)其中填补后的长度必须是个正整数,填补位置有三个选项,左边:STR_PAD_LEFT,右边:STR_PAD_RIGHT,两端:STR_PAD_BOTH例如:echo str_pad(1,8,”0″,STR_PAD_LEFT);结果:00000001echo str_pad(1,8,”0″,STR_PAD_RI...
前言问题:<br /> <b>Fatal error</b>: Uncaught Error: Class 'ZipArchive' not found in /www/wwwroot/f2.4936.cn/include/PHPExcel/Writer/Excel2007.php:220 Stack trace: #0 /www/wwwroot/f2.4936.cn/a/info/info-excel.php(215): PHPExcel_Writer_Excel2007->save() #1 {main} thrown in &...
PHP过滤各种html标签 strip_tags(剥去字符串中的 HTML 标签) strip_tags() 函数剥去字符串中的 HTML、XML 以及 PHP 的标签。
function addLog($msg,$time='') {if(empty($time)) { $time=date('Y-m-d H:i:s'); } $file = fopen('log_'.md5($GLOBALS['C']['SiteHash']).'.txt', "a"); fwrite($file, $time.' '.$msg."\r\n"); fclose($file); Return true;}
<div id="he-plugin-simple"></div> <script>WIDGET = {CONFIG: {"modules": "12034","background": 5,"tmpColor": "aaa","tmpSize": 16,"cityColor": "aaa","citySize": 16,"aqiSize...
<audio src="http://exe.maoley.com/mp3/20201213.mp3" autoplay="autoplay" loop="loop" id="bgAudio"></audio> <script type='text/javascript'>document.getElementById("bgAudio").volume = 0.2;//设置音量</script>