• 心情随笔

二宝博客

好记性不如赖笔头
二宝博客
  • android中CleartextHTTP错误解决方案
  • 示例页面
  • 首页
  • php
    • Thinkphp
  • JS相关
  • 服务器
    • Linux
    • Windows
    • xenserv
  • DIVCSS
  • MAC
  • 软件分享
  • php蜘蛛类

    php蜘蛛类

    “;                 return file_put_contents($file,$content);                 }          function getLogfile($time){             if(!$time)$time=time();             $logdir = LOG_PATH.'Spider'.date('Ym', $time).'/';             if(!is_dir($logdir))mkdir($logdir);     ...

    键盘游走者 发布于 2017-01-04 22:42php抢沙发
    查看
  • 关键字 替换类 替换(随机位置) 且指定数量的关键词

    关键字 替换类  替换(随机位置) 且指定数量的关键词

    array(“Key”=>”this”,”Href”=>”this“,”ReplaceNumber”=>1),     1=>array(“Key”=>”test”,”Href”=>”test“,”ReplaceNumber”=>1) ); $str = “this is test content!”; $a = new Seokey($KeyArray,$str); $a->KeyOrderBy(); $a->Replaces(); echo $a->HtmlString; */ class Seokey{     public $KeyArray;  //关键字     public $HtmlString; //文字内容     public $ArrayCount; //关键字的个数     public $Key;     public $Href;     /*         初始化:         $keyArray 关键字 数组         $String   检索字域,文字     */     function Seokey($KeyArray,$String,$Key='Key',$Href='Href'){        $this->KeyArray=$KeyArray;        $this->HtmlString=$String;        $this->ArrayCount=count($KeyArray);        $this->Key=$Key;        $this->Href=$Href;     }     /*         关键字 按长度排序     */     function KeyOrderBy(){         usort($this->KeyArray,'sortcmp');     }     function Replaces(){                      for($i=0;$i<$this->ArrayCount;$i++){             if((integer)$this->KeyArray[$i]['ReplaceNumber'] != 0 ){                 str_replace($this->KeyArray[$i][$this->Key],”/*”.md5($this->KeyArray[$i][$this->Key]).”*/”,$this->HtmlString,$num);//$num查询到的数量                 if((integer)$this->KeyArray[$i]['ReplaceNumber']>$num) {//当关键词 需要替换的数量 大于 包含的数量时,替换全部                     $this->KeyArray[$i]['ReplaceNumber']=$num;                     $this->HtmlString=str_replace($this->KeyArray[$i][$this->Key],”/*”.md5($this->KeyArray[$i][$this->Key]).”*/”,$this->HtmlString);                     continue;                 }                 //当关键词 需要替换的数量 不大于 包含的数量时,使用 KeyStrpos($i);方法替换                 $ListNumber=array();                 $ListNumber=$this->KeyStrpos($i);//$i: 表示第$i个关键词($i从0开始)                 $RegArray=array();                 if(count($ListNumber)<1) continue;//不存在 关键词                 $n=0;                 while($n<(integer)$this->KeyArray[$i][“ReplaceNumber”]){                     $g=0;                     $x=rand(0,count($ListNumber)-1);//随机数                     for($xcn=0;$xcn<=$n;$xcn++){                         if($RegArray[$xcn]==$ListNumber[$x]){                             $g=1;                         }                     }                     if($g==0){                         $RegArray[$n]=$ListNumber[$x];                         $n++;                     }                 }                 for($c=0;$c$RegArray[$jx]){                             $TempArray=$RegArray[$c];                             $RegArray[$c]=$RegArray[$jx];                             $RegArray[$jx]=$TempArray;                         }                     }                 }                 for($c=0;$cStrposKey($this->KeyArray[$i][$this->Key],$RegArray[$c],$c);// 逐位(索引位) 替换截取到的关键字                 }                $this->HtmlString=str_replace(“/&”.md5($this->KeyArray[$i][$this->Key]).”&/”,$this->KeyArray[$i][$this->Key],$this->HtmlString);             }else{                $this->HtmlString=str_replace($this->KeyArray[$i][$this->Key],”/*”.md5($this->KeyArray[$i][$this->Key]).”*/”,$this->HtmlString);             }        }        for($i=0;$i<$this->ArrayCount;$i++){            $this->HtmlString=str_replace(“/*”.md5($this->KeyArray[$i][$this->Key]).”*/”,$this->KeyArray[$i][$this->Href],$this->HtmlString);        }     }     function StrposKey($Key,$StrNumber,$n){//在字符串里 截取关键字 并替换,从$StrNumber这个位置开始(包含$StrNumber这个位置)替换到$n(包含$n这个位置)这个位置        $this->HtmlString=substr_replace($this->HtmlString, “/*”.md5($Key).”*/”, $StrNumber, 36);     }     /* 递归 查找 关键词 所在的位置 存于数组中 */     function KeyStrpos($KeyId){         $StrListArray=array();         $StrNumberss=strpos($this->HtmlString, $this->KeyArray[$KeyId][$this->Key]);         $xf=0;         while(!($StrNumberss===false)){             $StrListArray[$xf]=$StrNumberss;             $this->HtmlString=substr_replace($this->HtmlString,”/&”.md5($this->KeyArray[$KeyId][$this->Key]).”&/”,$StrNumberss, strlen($this->KeyArray[$KeyId][$this->Key]));             $StrNumberss=strpos($this->HtmlString, $this->KeyArray[$KeyId][$this->Key]);             $xf++;         }         return $StrListArray;     }     } ?>

    ]]>

    键盘游走者 发布于 2017-01-04 22:41php抢沙发
    查看
  • 新年新气象!让2016把带走一切的不愉快,2017努力吧!

    新年新气象!让2016把带走一切的不愉快,2017努力吧!

    RT

    ]]>

    键盘游走者 发布于 2017-01-04 22:40心情随笔抢沙发
    查看
  • 列目录程序Directory Lister H5ai

    列目录程序Directory Lister H5ai

    https://larsjung.de/h5ai/

    http://www.directorylister.com/

    ]]>

    键盘游走者 发布于 2016-12-13 19:20php抢沙发
    查看
  • Cron定时任务应用到Thinkphp

    Cron定时任务应用到Thinkphp

              安装crontab:           yum install crontabs                 关于cron的一些命令:           /sbin/service crond start //启动服务              /sbin/service crond stop //关闭服务              /sbin/service crond restart //重启服务              /sbin/service crond reload //重新载入配置   ...

    键盘游走者 发布于 2016-11-25 00:45Thinkphp抢沙发
    查看
  • webuploader上传多实例,一个页面多个上传按钮

    webuploader上传多实例,一个页面多个上传按钮

    一个项目中用到了 webuploader ,页面中需要一个页面多个实例,经过查看多种方法得出以下结论 在页面按钮处添加一个公用的类 filePicker,然后 onclick 写一个方法, class="filePicker" onclick="addWebuploadCurrent('banners')" 当触发时给input一个类     function addWebu ...

    键盘游走者 发布于 2016-11-14 20:22php抢沙发
    查看
  • Thinkphp中eq,neq,gt,lt等表达式缩写

    Thinkphp中eq,neq,gt,lt等表达式缩写

    eq 等于
    neq 不等于
    gt 大于
    egt 大于等于
    lt 小于
    elt 小于等于
    like LIKE
    between BETWEEN
    notnull IS NUT NULL
    null IS NULL

    ]]>

    键盘游走者 发布于 2016-11-09 20:49Thinkphp抢沙发
    查看
  • 汉字转换为拼音的JavaScript库

    汉字转换为拼音的JavaScript库

    摘要: 转自:http://my.oschina.net/ihotte/blog/66153 的好工具。汉字转换为拼音的JavaScript库 将JSPinyin剥离mootools这个JavaScript库,可以独立使用。 1)一个是将汉字翻译为拼音,其中每一个字的首字母大写;   pinyin.getFullChars(this.value); 2)一个是可以将每一个字的拼音的首字母提取出来 ...

    键盘游走者 发布于 2016-11-07 22:11JS相关抢沙发
    查看
  • 向一个字符串随机位置插入一个字符串

    向一个字符串随机位置插入一个字符串

    /** * 向一个字符串随机插入一个字符串 * @param unknown_type $oldstr    老字符串 * @param unknown_type $instr    插入的字符串 * @param unknown_type $encoding    字符串编码 */ function rand_in_str($oldstr,$instr,$encoding){ $len = mb_strlen($oldstr,$encoding); $insert_point = mt_rand(1,$len-1); $pr ...

    键盘游走者 发布于 2016-10-31 19:26php抢沙发
    查看
  • egister_shutdown_function 函数详解

    egister_shutdown_function 函数详解

    php开发测试及线上的时候可以根据不同情况设定错误和异常处理需要用到有 设定错误和异常处理三函数 register_shutdown_function(array(‘Debug’,'fatalError’)); //定义PHP程序执行完成后执行的函数set_error_handler(array(‘Debug’,'appError’)); // 设置一个用户定义的错误处理函数set_exception_handle ...

    键盘游走者 发布于 2016-10-21 17:51php抢沙发
    查看
« 上一页 1 … 15 16 17 18 19 … 40 下一页 »
2025 年 12 月
一 二 三 四 五 六 日
1234567
891011121314
15161718192021
22232425262728
293031  
« 10 月    

归档

  • 最新日志
  • 热评日志
  • 随机日志
  • 如何在Windows 7电脑上删除系统服务
  • L2TP and PPTP共存一键安装
  • C盘爆红,非微信占用,非休眠占用,非缓存占用那么可能是这个
  • 贝尔I-120E-QT光猫Telnet、导出配置文件 、语音鉴权密码
  • 解决Intel AC3160无线网卡 系统无法连接WIFI6路由器问题
  • 萤石 Y5 POE版 CS-Y5-V100-8B4EKFL 系列连不上海康录像机解决办法
  • pve查看网卡信息
  • TPLINK POE摄像机尾插坏了解决办法
  • 海康录像机怎样进入OSD配置?
  • Navicat Premium v17.2.3绿色版
  • Linux防火墙-iptables/firewalld的使用教程
  • Linux开关机命令:shutdown,reboot,halt,init之间的区别
  • 史上最全华为路由器交换机配置命令大合集
  • 交换机基本配置命令
  • 最新版本IDM
  • 一键修复系统更新造成的打印机无法共享2023.06.15
  • Android 9.0 网络权限的问题以及android:usesCleartextTraffic
  • 解决银河麒麟系统开机后桌面无图标,只有下方开始菜单和任务栏可操作问题
  • Win10安装打印机驱动程序失败提示“试图将驱动程序添加到存储区时遇到问题”解决方法
  • 遥志代-理服务器CCProxy
  • mysql怎么自动备份数据库
  • Mysql 按年度、季度、月度、周、日SQL统计查询
  • 在PHP中实现中文汉字验证码
  • 交换机基本配置命令
  • photoshop cc 2017 for Mac 和谐版本
  • 彻底关闭windows 10 病毒防火墙
  • FlashFXP 3.6.0 Build 1240 Final+注册(非破解)
  • 友好URL的实现
  • php整理常用时间戳和日期
  • Win10安装打印机驱动程序失败提示“试图将驱动程序添加到存储区时遇到问题”解决方法

最活跃的读者

最新评论

友情链接

  • 大宝博客
  • 白俊遥

Copyright © 2008 二宝博客. Powered by WordPress. Theme by Weisay. 豫ICP备2023032064号-1.