随笔分类 -  PHP

摘要:比如我要查询Elasticsearch库中字段为:id的有没有重复数据,可以用下面的方法,先查询出来,再执行删除。 from=0;size = 0; url=http://127.0.0.1/aaaaaa/search;data['from'] = from;data 阅读全文
posted @ 2023-02-23 11:36 赵瑛 阅读(512) 评论(0) 推荐(0) 编辑
摘要:其中的条件类似于mysql的where cate_id=cateidand(title=keyword or content=keyword)keyword = '常德学院'; cateid=148;url = 'http://127.0.0.1/aaaaaaa/_sea 阅读全文
posted @ 2023-02-22 16:42 赵瑛 阅读(353) 评论(0) 推荐(0) 编辑
摘要:<?php namespace ftp; /** * 作用:FTP操作类( 拷贝、移动、删除文件/创建目录 ) */ class ftp { public off;//(/)publicconn_id; // FTP连接 /** * 方法:FTP连接 * @FTP_H 阅读全文
posted @ 2023-02-20 10:48 赵瑛 阅读(75) 评论(0) 推荐(0) 编辑
摘要:为本人原创,转载请注明出处! 一、命令 /** * _search 查询命令 * _update_by_query 更新命令 * _delete_by_query 删除命令 */ 二、指定字段查询 $url = 'http://192.168.10.2:9200/article/_search'; 阅读全文
posted @ 2022-09-22 10:40 赵瑛 阅读(250) 评论(0) 推荐(0) 编辑
摘要:aa=ABCD;arr = explode(',',str_replace(array('A、','B、','C、','D、','E、','F、','G、','H、','A.','B.','C.','D.','E.','F.','G.','H.'), 阅读全文
posted @ 2022-07-29 17:05 赵瑛 阅读(189) 评论(0) 推荐(0) 编辑
摘要:ordercompanyid=78,43,23,19;exp = new \think\Db\Expression('field(web_company.company_id,'.$order_company_id.') desc,web_company.company_sort 阅读全文
posted @ 2022-07-26 10:58 赵瑛 阅读(316) 评论(0) 推荐(0) 编辑
摘要:zip=newZipArchive();//1:zip2ZIPARCHIVE::CREATEif(!zip->open("$exportPath.zip",ZIPARCHIVE::CREATE)) { echo "创建[$exportPath.zip]失 阅读全文
posted @ 2022-06-22 16:38 赵瑛 阅读(346) 评论(0) 推荐(0) 编辑
摘要:/* + * 功能:删除某个文件夹下所有的文件夹和文件 + * @param string dir+/functiondeldir(dir) { if (!is_dir(dir))returnfalse;handle = opendir($di 阅读全文
posted @ 2022-06-14 15:24 赵瑛 阅读(334) 评论(0) 推荐(0) 编辑
摘要:// 原目录,复制到的目录 function recurse_copy(src,dst) { dir=opendir(src); @mkdir(dst);while(false!==(file = readdir($dir)) ) { if (( $file != '.' ) 阅读全文
posted @ 2022-06-14 15:21 赵瑛 阅读(258) 评论(0) 推荐(0) 编辑
摘要:#方法一:使用 not in ,容易理解,效率低 ~执行时间为:1.395秒~ SELECT COUNT(1) FROM ecs_goods WHERE ecs_goods.goods_id NOT IN (SELECT ecs_member_price.goods_id FROM ecs_memb 阅读全文
posted @ 2022-02-23 11:36 赵瑛 阅读(1541) 评论(0) 推荐(0) 编辑
摘要:action('index/index/upload',['参数' => '参数值']); //第一种 controller('index/index')->upload('参数'); //第二种 阅读全文
posted @ 2022-01-25 09:27 赵瑛 阅读(528) 评论(0) 推荐(0) 编辑
摘要:exp=new\think\db\Expression((SELECTcount()fromnewswherenews.comid=company.comid)DESC);entlist = Db::name('company') ->join(' 阅读全文
posted @ 2021-11-16 09:39 赵瑛 阅读(223) 评论(0) 推荐(0) 编辑
摘要:问题:使用coreseek搜索关键词发现搜索出来数据还没有mysql模糊查询的数据多。。。问题出在配置的参数上。 代码如下: <?php require_once('sphinxapi.php'); key=isset(_GET['keys'])?GET[keys]:;p 阅读全文
posted @ 2021-11-15 08:19 赵瑛 阅读(188) 评论(0) 推荐(0) 编辑
摘要:记录一下这种判断写法 sqlModel=Db::name(news);sqlModel = sqlModel>where(endtime,>=,time());sqlModel = sqlModel>where(begintime,<=,time()); 阅读全文
posted @ 2021-11-10 16:43 赵瑛 阅读(613) 评论(0) 推荐(0) 编辑
摘要:// 仿 Word 统计文章字数,和 word 统计出来的一致 function comment_count_word($str){ //str=characet(str); //判断是否存在替换字符 istihuancount=substrcount(str,"龘"); try { 阅读全文
posted @ 2021-11-08 16:07 赵瑛 阅读(135) 评论(0) 推荐(0) 编辑
摘要:/* + * 去掉html中的空格和换行的方法 + */ function delhtml($str) { str=trim(str); //清除字符串两边的空格 str=striptags(str,""); //利用php自带的函数清除html格式 $str = preg_rep 阅读全文
posted @ 2021-10-19 16:12 赵瑛 阅读(662) 评论(0) 推荐(0) 编辑
摘要:你在网上搜索tp6的session,会有大量的说开启中间件的文件,无一例个,全都行不通。 当然,中间件里开启是必须的,生成的session文件目录给写入权限也是必须的,但这样,还是无法使用session。 经过搜索,最后发现是需要在方法中加入:\think\facade\Session::save( 阅读全文
posted @ 2021-10-18 11:03 赵瑛 阅读(1566) 评论(0) 推荐(0) 编辑
摘要:使用环境为php7.3 function createZip(openFile,zipObj,sourceAbso,newRelat = '') { while((file=readdir(openFile)) != false) { if(file=="."||file== 阅读全文
posted @ 2021-08-18 11:44 赵瑛 阅读(368) 评论(0) 推荐(0) 编辑
摘要:合并数组的方法 array_merge 如:array_merge(data1,data2); 数组去重 //1.单数组去重复 array_unique(arrTest)//2.arraykeys(arrayflip(arr1)+array_flip($arr2)) 阅读全文
posted @ 2021-08-12 08:57 赵瑛 阅读(208) 评论(0) 推荐(0) 编辑
摘要:/* * 参数说明: tagid:TagIdurl:所要获取页面的Url tag:data */ function getWebTag(tagid,url = false, tag=div,data = false) { if ($u 阅读全文
posted @ 2021-08-10 11:30 赵瑛 阅读(348) 评论(0) 推荐(0) 编辑

版权所有 © 2022 沅来是澧

如果有程序开发、网站建设等需求的请联系我,QQ:47419233

点击右上角即可分享
微信分享提示