php
龙笑love
码农
展开
-
微信小程序隐私指引完整填写范本示例
微信小程序隐私指引完整填写范本示例原创 2023-02-17 16:48:37 · 392 阅读 · 0 评论 -
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 · 268 阅读 · 0 评论 -
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 · 324 阅读 · 0 评论 -
php 获取当天的开始时间和结束时间的时间戳
$start_time = strtotime(date("Y-m-d",time())); //今天的开始时间$end_time = $start_time+24*60*60-1; //今天的结束时间原创 2021-10-16 17:09:35 · 813 阅读 · 0 评论 -
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 · 944 阅读 · 0 评论 -
tp5 数组进行分页
首页引入文件use think\paginator\driver\Bootstrap;原创 2021-08-11 17:27:34 · 238 阅读 · 0 评论 -
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 · 778 阅读 · 0 评论 -
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 · 623 阅读 · 0 评论 -
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 · 239 阅读 · 0 评论 -
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 · 349 阅读 · 0 评论 -
手机邮箱验证 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 · 184 阅读 · 0 评论 -
修改 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 · 560 阅读 · 0 评论 -
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 · 4434 阅读 · 0 评论 -
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 · 497 阅读 · 0 评论 -
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 · 603 阅读 · 0 评论 -
微擎 人人商城 头像获取失败问题
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 · 1188 阅读 · 0 评论 -
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 · 579 阅读 · 0 评论 -
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 · 222 阅读 · 0 评论 -
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 · 1243 阅读 · 0 评论 -
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 · 5485 阅读 · 0 评论 -
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 · 230 阅读 · 0 评论 -
thinkphp5.1 查询构造器的数组多字段批量查询
//原来tp5.0是这样的 $where=[ 'name'=>['like','think%'], 'id'=>['>',0] ];//现在tp5.1是这样的 $where...原创 2019-04-26 10:01:32 · 997 阅读 · 0 评论 -
前台PHP微信分享功能
function Share(config,shareinfo){ window.wx.config({ debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId: 'xxxxx', // 必填,公众号的唯一标识 ...原创 2019-04-01 12:00:38 · 376 阅读 · 0 评论 -
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 · 716 阅读 · 0 评论 -
解决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 · 2428 阅读 · 0 评论 -
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 · 783 阅读 · 0 评论