摘要:
function chunk(arr, size = 2) { var final = []; for(var i = 0, len = arr.length; i < len; i += size) { final.push(arr.slice(i, i + size)); } return fi 阅读全文
摘要:
封装类: class Ajax { constructor(obj) { var async = obj.async == undefined ? true : obj.async; var xhr = new XMLHttpRequest(); xhr.onreadystatechange = f 阅读全文
摘要:
// 设定验证码中可能出现的文字 $str = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $result = ''; // 取随机4位做验证码 for($i = 0; $i < 4; $i ++) { $res 阅读全文
摘要:
一,安装Elasticsearch-PHP 首先安装Composer,参考:参考博客 在文件夹中新建文件composer.json,写入以下内容: { "require": { "elasticsearch/elasticsearch": "~6.0" } } 保存后在同级目录下执行命令: comp 阅读全文
摘要:
一,下载安装包 下载Elasticsearch:点击下载,选择Linux版本 二,安装Elasticsearch 解压缩,并进入根目录: 编辑limits.conf内容: vim /etc/security/limits.conf 在文档末尾加入: * soft nofile 65536 * har 阅读全文
摘要:
/** * @param $url 远程图片、文件、网页URL路径 * @param $savePath 要保存的文件夹 * @param $saveName 要保存的文件名 * @return false|string */ function xmsb_saveFromUrl($url, $sav 阅读全文
摘要:
header('Access-Control-Allow-Origin: *'); header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept"); header('Access-Contr 阅读全文
摘要:
function typing(that) { that = typeof(that.length) == 'undefined' ? [that] : that; for(var i = 0; i < that.length; i ++) { let text = that[i]; let str 阅读全文
摘要:
<!doctype html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, 阅读全文
摘要:
var xhr = new XMLHttpRequest(); xhr.open("POST", "http://www.baidu.com", true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencode 阅读全文