- 博客(19)
- 收藏
- 关注
原创 left join 一对多时数据合并处理
function list(){ $arr = [ [ 'id' => 1, 'name' => '张三', 'title' => '深圳', ], [ 'id' => 1, 'name' => '张三', ...
2021-10-02 04:05:03
1527
原创 git常用命令
git常用命令git提交代码:git add .git commit -m "提交"git push origin mastergit强制覆盖本地命令(单条执行):git fetch --all && git reset --hard origin/master && git pullgit清除本地账号密码 方式1、2方式1.git config --global credential.helper wincred方式2.git config -
2021-09-19 17:08:02
106
原创 php 获取某一个指定时间点(时间戳)的上周周一的起始时间戳(00:00)
PHP获取某一个指定时间点(时间戳)的上周周一的起始时间戳(00:00)//获取某一个指定时间点(时间戳)的上周周一的起始时间戳(00:00)$start_time = strtotime('monday last week', $time);
2021-09-11 16:52:13
523
原创 PHP 抓取静态页面,解决文件编码问题 UTF-8,GBK
public function test() {// $url = 'http://finance.people.com.cn/n1/2021/0824/c1004-32204729.html'; //gpk// $url = 'https://sz.oeeee.com/html/202109/07/1133661.html';// $url = 'http://opinion.people.com.cn/GB/8213/420650/in...
2021-09-08 14:05:44
294
原创 php检测文件内容编码的方法
<?phpheader("Content-type: text/html; charset=utf-8");/** * 获取内容的编码 * @param string $str */function get_encoding($str = "") { $encodings = array ( 'ASCII', 'UTF-8', 'GBK' ); foreach ( $encodings as $encoding
2021-09-08 13:42:43
543
原创 apache、nginx伪静态
伪静态apache:<IfModule mod_rewrite.c>RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]</IfModule>2.nginx: location / { index index.html ind
2021-09-06 09:25:10
89
原创 PHP 批量生成名字和头像插入数据库
<?phpnamespace app\api\controller;use think\facade\Db;class Test{ public function sql() { $length = 1000; $data = []; for ($i = 0; $i < $length; $i++) { $phone = '1' . mt_rand(1000000000, 9999999
2021-08-29 22:03:13
674
原创 PHP后台守护进程的实现方式(Linux环境)
1.创建 test.php 文件<?phpwhile (true) { try { $content=mt_rand(1,200)."\n"; $file='./test.txt'; if($f = file_put_contents($file, $content,FILE_APPEND)){ }// echo file_get_contents($file); } catch (\Excepti
2021-08-16 01:20:25
720
原创 php无限分类
php无限分类<?php// 转载:: https://www.cnblogs.com/xuey/p/8629487.html$array = array( array('id' => 1, 'pid' => 0, 'n' => '河北省'), array('id' => 2, 'pid' => 0, 'n' => '北京市'),...
2019-11-08 05:15:31
131
原创 select 切换选中
select 切换选中 关键词 prop(),不能用attr()html 部分 <div class="form-group"> <label class="col-lg-2 control-label" style="width: 110px;height: 34px;line-height: 34px...
2019-07-01 18:02:55
685
转载 Moment函数上周/上月/今年/去年等时间开始和结束数组
Moment() JS注意区分大小写, moment() //时间变更 require(["daterangepicker"], function(){ $(function(){ $(".daterange.daterange-date").each(function(){ var elm =...
2019-06-13 09:46:01
3648
转载 查询表1的id 不已存在表2里,
表字段过滤查询表1的id 不已存在表2里, $list=pdo_fetchall('SELECT id,tname FROM '.tablename($this->table_teachers) . "where id not in (select tid from ims_wx_school_gz_settlement) AND weid = '{$weid}' AND sc...
2019-06-10 15:16:35
196
转载 PHP 数组与Object的转换
//调用这个函数,将其幻化为数组,然后取出对应值function object_array($array){ if(is_object($array)) { $array = (array)$array; } if(is_array($array)) { foreach($array as $key=>$value) { $array[$key] = object_array($value); } } return $a
2019-05-01 17:46:26
20389
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人