- 博客(32)
- 资源 (5)
- 收藏
- 关注
原创 php处理微信名称过滤emoji特殊符号
function filternickname($nickname){ $nickname = preg_replace('/[\x{1F600}-\x{1F64F}]/u', '', $nickname); $nickname = preg_replace('/[\x{1F300}-\x{1F5FF}]/u', '', $nickname); $nickname = preg_replace('/[\x{1F680}-\x{1F6FF}]/u', '', $ni
2023-07-01 11:10:02
1242
原创 php怎么禁用eval函数,安装suhosin扩展
安装扩展第一步wget http://download.suhosin.org/suhosin-0.9.37.1.tar.gz tar zxvf suhosin-0.9.37.1.tar.gz第二步cd suhosin-0.9.37.1/第三步phpize第四步./configure --with-php-config=/usr/local/bin/php-config第五步make第六步make install在etc/php.ini中加入如下代码,启用当前扩展extens
2022-01-14 15:01:49
333
原创 php 使用htm table导出Excel设置字符串文本显示
<td style="vnd.ms-excel.numberformat:@;">4324343434343434343434</td>//1)文本:vnd.ms-excel.numberformat:@//2)日期:vnd.ms-excel.numberformat:yyyy/mm/dd//3)数字:vnd.ms-excel.numberformat:#,##0.00//4)货币:vnd.ms-excel.numberformat:¥#,##0.00//5)百分比:vn
2021-12-09 18:13:36
381
原创 php 获取当天的开始时间和结束时间的时间戳
$start_time = strtotime(date("Y-m-d",time())); //今天的开始时间$end_time = $start_time+24*60*60-1; //今天的结束时间
2021-10-16 17:09:35
890
原创 apicloud APP获取相机权限执行二维码扫描操作
html<div> <a href="javascript:void(0)" style="padding:.3rem 0.5rem;" class="saomiao"> <img src="__STYLE__/img/saoma.png" alt="" style="width: 1rem;height: 1rem;display: block;"> </a></div>js<script&...
2021-09-10 15:11:37
1016
原创 thinkPHP 级差公式代码
<?php// $price 奖励金额 $user_id 用户idfunction _range($price,$user_id){ //用户id $user = Db::name('user')->where('id',$user_id)->find(); //用户的所有上级 $path = Db::name('user')->where('id',$user['id'])->value('path'); $path...
2021-04-27 09:23:35
906
原创 thinkphp5.0 中paginate分页后用foreach插入追加的字段
public function stockLog(){ //1先进行paginate分页查询 $account_stock_log=Db::name('account_stock_log')->alias('as') ->field('g.goods_name,as.*,o.order_sn') ...
2021-03-20 15:58:36
700
原创 thinkphp 获取两坐标之间的距离
//获取距离 public function space(){ //获取距离 // 我的位置 $latitude=input('latitude'); $longitude=input('longitude'); //店铺位置 $shop_latitude=input('shop_latitude'); $shop_longitude=input('shop_longitude');...
2021-01-30 08:49:33
324
原创 thinkphp 根据地址获取经纬度坐标
/*** @param string $address 详细地址 格式:河南省郑州市金水区永和国际* @return array*/function get_LatLng($address){ if(!$address)return ''; $result = array(); $ak = '';//您的百度地图ak,可以去百度开发者中心去免费申请 $url = "http://api.map.baidu.com/geocoding/v3/?address="...
2021-01-29 18:53:21
418
原创 手机邮箱验证 js
function checkMobile(tel) {// var reg = /(^1[3|4|5|7|8][0-9]{9}$)/; var reg = /^1[0-9]{10}$/; if (reg.test(tel)) { return true; }else{ return false; }; } function checkEmail(str...
2021-01-22 11:04:07
217
原创 修改 tp5 分页 paginate的样式
<style type="text/css"> .pagination li{list-style:none;float:left;margin-left:10px; padding:0 10px; background-color:#5a98de; border:1px solid #ccc; height:26px; line-height:26px; cursor:pointer;col...
2021-01-17 20:33:34
627
原创 tp5 时间查询 whereTime用法
Db::whereTime('time','today')->select() //获取今天的数据Db::whereTime('time','yesterday')->select() //获取昨天的数据Db::whereTime('time','week')->select() //获取本周的数据Db::whereTime('time','last week')->select() //获取上一周的数据Db::whereTime('time','month')-&g
2021-01-05 21:50:12
4945
原创 php 生成推荐码
//递归推荐码不重复 public function getcode(){ $code = $this->myRand(); $isexist = Db::name('tuijian_code')->where('code',$code)->find(); if(empty($isexist)){ return $code; }else{ return $this-&g...
2020-11-11 10:08:04
543
原创 thinkphp 开发项目常用的函数
1、array_merge() 把两个或多个数组合并成一个数组2、array_diff() 返回两个数组的差集数组3、in_array('a',$arr):搜索数组中是否存在指定的值。4、array_sum():返回数组中所有值的和。5、array_shift():删除数组中的第一个元素,并返回被删除元素的值。6、array_key_exists($key,$arr):查询数组中是否存在指定的键名。7、count()函数的作用是计算数组中的元素数目或对象中属性个数。对于数组,返回其.
2020-11-11 10:06:57
680
原创 MyEclipse快速开发项目,常用的快捷键
-------------------------------------MyEclipse 快捷键1(CTRL)-------------------------------------Ctrl+1 快速修复Ctrl+D: 删除当前行Ctrl+Q 定位到最后编辑的地方Ctrl+L 定位在某行Ctrl+O 快速显示 OutLineCtrl+T 快速显示当前类的继承结构Ctrl+W 关闭当前EditerCtrl+K 快速定位到下一个Ctrl+E 快速显示当前Edi...
2020-10-29 14:23:37
143
原创 微擎 人人商城 头像获取失败问题
1 第一步UPDATE `ims_ewei_shop_member` SET avatar=REPLACE(avatar, '/132132', '/132');2第二步/WEB/addons/ewei_shopv2/core/model/member.php在checkMember() 354行左右3第三步 $mc['avatar'] = str_replace('/132132', '/132',$userinfo['headimgurl']);...
2020-10-24 10:43:48
1310
原创 php 查询会员的所有下级
//获取用户的所有下级IDfunctionget_downline($members,$id){$arr=array();foreach($membersas$key=>$v){if($v['agentid']==$id){//pid为0的是顶级分类$arr[]=$v;$arr=array_...
2020-10-24 10:32:40
646
原创 thikphp6开发项目文档的插件
tp6队列消息composer require topthink/think-queue//配置文件位于config/queue.php[ 'default'=>'sync' //驱动类型,可选择 sync(默认):同步执行,database:数据库驱动,redis:Redis驱动,topthink:Topthink驱动]验证码生成composer require topthink/think-captcha//控制器中public function captcha(
2020-09-26 08:48:19
270
原创 TP6开发文档插件
tp6队列消息composer require topthink/think-queue//配置文件位于config/queue.php[ 'default'=>'sync' //驱动类型,可选择 sync(默认):同步执行,database:数据库驱动,redis:Redis驱动,topthink:Topthink驱动]验证码生成composer require topthink/think-captcha//控制器中public function captcha(
2020-09-26 08:23:54
1300
原创 TP6开发文档实用手册
请求变量use think\facade\Request;Request::param('name');Request::param();全部请求变量 返回数组Request::param(['name', 'email']); 多个变量Request::param('a','1') $a不存在使用默认值1Request::param('username','','strip_tags'); 参数过滤 去掉html标签 htmlspecialchars转换成实体入库 strtolower小写
2020-09-26 08:23:00
5632
原创 CentOS下搭建Git服务器
1、首先需要安装Git,可以使用yum源在线安装:[root@localhost Desktop]# yum install -y git2、创建一个git用户,用来运行git服务# adduser git 3、初始化git仓库:这里我们选择/data/git/learngit.git来作为我们的git仓库[root@localhost git]# git init -...
2020-03-27 09:05:10
293
原创 thinkphp5.1 查询构造器的数组多字段批量查询
//原来tp5.0是这样的 $where=[ 'name'=>['like','think%'], 'id'=>['>',0] ];//现在tp5.1是这样的 $where...
2019-04-26 10:01:32
1037
原创 前台PHP微信分享功能
function Share(config,shareinfo){ window.wx.config({ debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId: 'xxxxx', // 必填,公众号的唯一标识 ...
2019-04-01 12:00:38
398
原创 PHP微信分享功能
<?phpnamespace app\index\controller;use think\Controller;use think\Db;use think\Request;use think\Session;use think\Loader;class Shar extends Base{ private $appid = 'xxxxxx'; priva...
2019-04-01 11:57:06
770
原创 解决tp5框架PHP文件不能用php7执行
在public下的 .htaccess文件添加<IfModule mod_rewrite.c>Options +FollowSymlinksRewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ index.php?/$...
2019-03-22 17:56:05
2484
原创 PHP 图片上传/ 64位上传
<?phpnamespace app\index\controller;use think\Controller;use think\Db;use think\Request;use think\Session;use app\index\model\Member;class Uploads extends Controller{ public function ...
2019-03-22 17:48:11
815
原创 搭建LAMP环境(一)centos7 安装mysql5.6
Centos7安装MySQL安装gcc、gcc-c++# yum -y install gcc# yum -y install gcc-c++# cd /root/lamp/# wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.39.tar.gz# tar -zxvf mysql-5.6.39.tar.gz...
2018-12-08 10:24:11
170
原创 centos7安装samba,实现共享文件夹,Windows远程访问centos文件
检查samba环境rpm -qi samba安装yum -y install samba samba-client配置进入samba配置目录cd /etc/samba/备份smb.confmv smb.conf smb.conf.origin 新建smb.confvim smb.conf内容如下,保存并退出[global] w...
2018-12-07 14:31:46
2496
原创 1 站内优化怎么做 需要注意哪些细节
网站优化分为站内优化与站外推行,站内优化首要是优化网站与查找引擎之间友好度、信任度,以此进步网站录入、权重以及关键词的排名,站外推行首要是引流、推行品牌;许多新手站长在做网站优化,站内优化只朴实的更新文章,要点放在了站外推行,以至于站内优化力度不行,导致网站权重、关键词排名难以上升。下面深度网小编与咱们共享,针对站内优化需求做的细节问题,以便咱们更好优化网站。站内优化需求做的作业 1、网站域名与...
2018-07-27 17:55:19
207
thinkphp5.1
2018-12-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人