php判断文件是否存在:file_exists函数 — 检查文件或目录是否存在代码:<?php $file = "gaojiufeng.txt"; if(file_exists($file)) { echo...
levenshtein函数可以计算两个字符串之间的编辑距离,那么何为编辑距离?编辑距离概念:编辑距离,是指两个字串之间,通过替换or插入or删除等操作将字符串str1转换成str2所需要操作的最少字符数量。 该算法的复杂度是 O(m*n),其中 n 和 m 分别是str1 和str2的长度注意:如果...
安装谷歌驱动的时候centos报错“error while loading shared libraries: libgconf-2.so.4: cannot open shared object file”安装依赖即可:yum install GConf2...
1.什么是Chrome Headless?Headless Chrome 是 Chrome 浏览器的无界面形态,可以在不打开浏览器的前提下,使用所有 Chrome 支持的特性运行你的程序,简而言之,除了没有图形界面,headless chrome具有所有现代浏览器的特性,可以像在其他现代浏览器里一样...
习惯用gitbash连接ssh,但是长时间无操作直接断开,简单配置一下:vim /etc/ssh/sshd_config ClientAliveInterval 30 #每隔30秒发送一次请求给client,然后client响应,从而...
nginx版本:<?php //告诉nginx禁止缓存老夫的响应内容 header('X-Accel-Buffering: no'); // nginx要加这一行 //打开缓冲区 if (ob_get_level() ==&...
百度统计“网站速度测试”中提示的。需要在html的head中添加如下代码:<meta http-equiv="content-type" content="text/html; charset=UTF-8" /&g...
在workerman中我们可以看到常用的socket事件onConnect,onMessage,onClose,实际上socket不存在这些事件,workerman只是为了方便开发者。自己也在写相关的东西,正好记录下。(1).当socket可读,通过stream_socket_accept 或者so...
socket_import_stream函数可以将使用stream_socket_server创建stream socket句柄转换为标准的socket句柄,因为标准socket支持更多的配置选项。在workerman中有如下代码:if (function_exists('sock...
php中stat(), lstat(), file_exists(), is_writable(), is_readable(), is_executable(), is_file(), is_dir(), is_link(), filectime(), fileatime(), filemtime...