
php
xudejun
这个作者很懒,什么都没留下…
展开
-
mysql 预查询-无限极分类
class Test extends Controller{ public function index(){ $id = input('id'); //$this->setparent(); $this->setchild($id); } public function setparent(){ $list = []; $list = db('ce')->insert([ .原创 2021-07-19 16:47:20 · 397 阅读 · 0 评论 -
phpexcel 导入导出
//导出function export_Excel($data,$title){ $path = dirname(__FILE__); //找到当前脚本所在路径 $PHPExcel = new PHPExcel(); //实例化PHPExcel类,类似于在桌面上新建一个Excel表格 $PHPSheet = $PHPExcel->getActiveSheet();...原创 2019-05-21 17:37:18 · 198 阅读 · 0 评论 -
php excel ajax 导出文件
$list = [];//要导出的数据 $path = dirname(__FILE__); //找到当前脚本所在路径 vendor("PHPExcel.PHPExcel.PHPExcel"); vendor("PHPExcel.PHPExcel.Writer.IWriter"); vendor("PHPExcel.PHPExce...转载 2019-02-26 11:00:25 · 1312 阅读 · 0 评论 -
API token身份验证 (thinkphp5)
使用说明:登陆时生成token和刷新用的refresh_token,返回给客户端,客户端收到保存本地localStorage等,每次访问接口带上token,后端验证token存在并且一致后方可执行接下来的动作,假如不存在就返回token过期,客户端调用刷新接口传入token和refresh_token,服务器端进行验证,验证通过重新生成新的token保存数据库,返回给客户端客户端刷新本地toke...原创 2019-02-20 11:42:31 · 5410 阅读 · 1 评论 -
js thinkphp5 图片上传 可预览 可删除
HTML部分<style>.upload_btn{margin-left: 100px; border: none; background-color: #0e947a; width: 80px; height: 30px; font-size: 16px; color: #fff5d4;}.upload_cc{z-index:1; width: 80px; height:...原创 2018-11-08 09:15:18 · 287 阅读 · 0 评论 -
PHP 数组按照分类来组装,可用于无限级分类
html页面<form class="form form-horizontal" class="layui-form" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}"> <input type="hidden"原创 2018-12-06 10:14:28 · 748 阅读 · 0 评论 -
jquery php 省市区联动
JS: $("#from_prov_id,#from_city_id").change(function () { var current_prov_id = $(this).val(); var _this = this; $.ajax({ type:'get', url:"{:url('...原创 2018-11-26 17:11:53 · 393 阅读 · 0 评论 -
php curl API接口类
<?phpnamespace curl;/** * Created by PhpStorm. * User: Administrator * Date: 2017/6/16 * Time: 9:54 */class ApiClient{//请求的token const token='token_str'; //请求url private $...原创 2018-11-05 16:02:35 · 1025 阅读 · 0 评论 -
workerman 从服务器端向用户端推送消息代码
数据推送<?php$client = stream_socket_client('tcp://127.0.0.1:5678', $errno, $errmsg, 1);// 推送的数据,包含用户,表示是给这个用户推送$data = array('uid'=>'','group'=>'admin', 'message'=>'发送成功啦');// 发送数据,注意...原创 2018-11-05 15:46:23 · 5493 阅读 · 0 评论 -
nginx php7 配置 (多配置文件方式)
1,在nginx.conf 文件中添加include vhosts/*.conf; 2,在vhosts文件夹中新建 www.dome.com.conf文件 ,配置内容如下:server { listen 80; server_name www.test.com; root d:/server/www; location / { index index...原创 2018-10-19 16:04:27 · 1022 阅读 · 0 评论 -
PHP mysql 批量插入数据
php向mysql插入百万数据只需不到一分钟时间,之间还可以优化<?phpset_time_limit(0);$dsn = 'mysql:dbname=test;host=localhost;port=3306';$username = 'root';$password = '123456';try { $pdo = new PDO($dsn, $username, ...原创 2018-10-15 17:33:33 · 2553 阅读 · 0 评论 -
ajax php 视频,大型文件上传
html页面<!doctype html><html lang="zh"><head> <meta charset="utf-8"> <title>HTML5 Ajax Uploader</title> <script src="https://原创 2018-10-12 08:54:21 · 1544 阅读 · 0 评论