随笔分类 -  php

摘要:$str = '姓名:{username},年龄:{age}'; preg_match_all("/[{](.*?)[}]/", $str, $res);//加?,使用非贪婪模式 return $this->success($res); { "status": "true", "code": 200 阅读全文
posted @ 2021-11-04 16:48 CanyingV 阅读(28) 评论(0) 推荐(0)
摘要:bc函数库 https://www.php.net/manual/zh/ref.bc.php 阅读全文
posted @ 2021-09-30 14:30 CanyingV 阅读(43) 评论(0) 推荐(0)
摘要:public function index() { $data = [ [ 'id' => 1, 'b' => '11', 'c' => '11', ], [ 'id' => 2, 'a' => '33', 'b' => '33', ], [ 'id' => 3, 'a' => '22', 'b' 阅读全文
posted @ 2021-09-08 09:10 CanyingV 阅读(52) 评论(0) 推荐(0)
摘要://导出excel public function dataToExcel($filename, $data, $header, $keys) { $html = $this->dataToHtml($data, $header, $keys); return $this->htmlToExcel( 阅读全文
posted @ 2021-09-07 08:45 CanyingV 阅读(105) 评论(0) 推荐(0)
摘要://获取某个日期所在月的第n周的时间范围(第一周 1号至7号) function getOneWeekByDate($date = '', $n = 5) { $date = strtotime('20211001'); $t = date('t', $date); //当月天数 $n_max = 阅读全文
posted @ 2021-08-27 14:03 CanyingV 阅读(78) 评论(0) 推荐(0)
摘要://获取指定日期所在月的各个周的时间范围 第一周 1号至7号 以此类推 function getWeekByDate($date) { $date = strtotime($date); //月初日期 $start_time = mktime(0, 0, 0, date('m', $date), ' 阅读全文
posted @ 2021-08-26 09:29 CanyingV 阅读(201) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2021-04-21 17:52 CanyingV 阅读(0) 评论(0) 推荐(0)
摘要:我们可以从上传视频中截取固定时间点的帧,以作为这些视频的封面图片。视频截图如下所示: http://<your_uploaded_video>?vframe/jpg/offset/5 阅读全文
posted @ 2021-04-01 17:43 CanyingV 阅读(325) 评论(0) 推荐(0)
摘要:<script language="JavaScript"> if (window != top) top.location.href = location.href; </script> 阅读全文
posted @ 2021-03-30 15:23 CanyingV 阅读(32) 评论(0) 推荐(0)
摘要:function fileShow($dir){ $handle = opendir($dir); // 打开目录句柄 while ($file = readdir($handle)) { // 返回目录句柄中的条目 if ($file !== '..' && $file !== '.') { $f 阅读全文
posted @ 2021-03-16 13:39 CanyingV 阅读(77) 评论(0) 推荐(0)
摘要:$phar = new PharData('leixuesong.tar.gz'); //解压后的路径 数组或者字符串指定解压解压的文件,null为全部解压 是否覆盖 $phar->extractTo('./tmp', null, true); 阅读全文
posted @ 2021-03-16 11:13 CanyingV 阅读(181) 评论(0) 推荐(0)
摘要:public function index() { $str = '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB 阅读全文
posted @ 2021-03-12 15:47 CanyingV 阅读(1856) 评论(0) 推荐(0)
摘要://gps转wgs $a=12012.452136 public static function gps2Wgs($a) { return floor($a / 100) + fmod($a, 100) / 60; } 阅读全文
posted @ 2021-03-12 15:27 CanyingV 阅读(337) 评论(0) 推荐(0)
摘要:$url='www.test.com?name=a&age=1'; $res=parse_url($url); parse_str($res['query'],$res);var_dump($res); { "status": 200, "message": "操作成功", "result": { 阅读全文
posted @ 2021-02-02 14:48 CanyingV 阅读(118) 评论(0) 推荐(0)
摘要:public function index() { if(Request::isPost()){ if(password_verify('123456','$2y$10$1/UPLaqLTJ3RNjTCfgb6.ewfbRDSyINdNOan8uI/WOuMymbY5cNbm')){ return 阅读全文
posted @ 2021-01-29 14:11 CanyingV 阅读(59) 评论(0) 推荐(0)
摘要:public function is_point_in_polygon($point, $pts) { $N = count($pts); $boundOrVertex = true; //如果点位于多边形的顶点或边上,也算做点在多边形内,直接返回true $intersectCount = 0;/ 阅读全文
posted @ 2020-11-21 17:35 CanyingV 阅读(929) 评论(0) 推荐(0)
摘要:if(! function_exists('bdEncrypt')) { //GCJ-02(火星,高德)坐标转换成BD-09(百度)坐标 //@param $longitude 高德经度 //@param $latitude 高德纬度 function bdEncrypt($longitude,$l 阅读全文
posted @ 2020-11-21 17:30 CanyingV 阅读(369) 评论(0) 推荐(0)
摘要:public function curlrequest($url,$data,$method = 'GET',$type='json',$headers=[]) { try{ //初始化 $ch = curl_init(); $headers[] = "cache-control: no-cache 阅读全文
posted @ 2020-10-24 16:01 CanyingV 阅读(76) 评论(0) 推荐(0)
摘要:<iframe src="http://i.tianqi.com/index.php?c=code&id=7" ></iframe> 阅读全文
posted @ 2020-10-11 16:10 CanyingV 阅读(54) 评论(0) 推荐(0)
摘要:$.ajax({ url:"{:url('user')}", data:{"group_id":data.value}, type:'post', dataType:'json', success:function (res) { console.log(res); for(var i=0;i<re 阅读全文
posted @ 2020-09-16 08:59 CanyingV 阅读(93) 评论(0) 推荐(0)