
php
HD2killers
这个作者很懒,什么都没留下…
展开
-
反转义var_dump
适用于 array相关讨论$str = <<<strarray(1) { [0] => array(25) { ["catid"] => int(1) ["type"] => int(0) ["modelid"] => int(0) ["domain"] => NULL转载 2019-03-18 16:28:06 · 432 阅读 · 0 评论 -
centos7安装nginx配置php-fpm
centos7安装nginx配置php-fpm 安装nginx,使用SCL源# 安装yum install rh-nginx112-nginx# 查看服务名称systemctl list-unit-filesrh-nginx112-nginx.service# 启动,即可访问ip浏览systemctl start rh-nginx112-nginx.service ...原创 2018-09-17 10:41:07 · 1276 阅读 · 0 评论 -
使用layUI分页ajax数据,way.js数据双向绑定
前端&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;link rel="stylesheet" type="text/css&q原创 2018-07-28 11:11:13 · 1011 阅读 · 0 评论 -
是使用layUI渲染表格(方法渲染)
前端<!DOCTYPE html><html><head> <title></title> <link rel="stylesheet" type="text/css" href="./layui/css/layui.css?t=20180403-1"&原创 2018-07-27 16:28:26 · 1553 阅读 · 0 评论 -
上拉加载数据结构
前端使用mescroll 网站 githubvar mescroll = new MeScroll("mescroll", { //第一个参数"mescroll"对应上面布局结构div的id //如果您的下拉刷新是重置列表数据,那么down完全可以不用配置,具体用法参考第一个基础案例 //解析: down.callback默认调用mescroll.reset...原创 2018-07-27 14:52:26 · 258 阅读 · 0 评论 -
获取ip地理环境的api
程序 public function index() { $api_url = 'http://ip.taobao.com/service/getIpInfo.php'; $ip = '125.85.206.146'; $get_url = $api_url . '?ip=' . $ip; $r...原创 2018-07-26 17:04:05 · 162 阅读 · 0 评论 -
Grafika处理图像,显示推广码
安装 githubcomposer require kosinix/grafika 使用use Grafika\Color;use Grafika\Grafika; /** * 获取用户的推广图片 * @param integer $uid [UID] * @param string $text [姓名...原创 2018-07-26 16:40:44 · 746 阅读 · 0 评论 -
缓存(或者session)生成短信验证码
<?phpnamespace app\common\smslxx;use think\Cache;/** * * * Class Smslxx * 使用缓存,缓存键前缀sms * @package app\common\smslxx */class Smslxx{ const CODE_LENTH = 4; //验证码长度,最大9 const ...原创 2018-07-26 16:22:28 · 863 阅读 · 0 评论 -
TP5接入快递查询api
安装PHP Wrapper for KuaiDi100. githubcomposer require xu42/kuaidi100 使用<?phpnamespace app\index\controller;use think\Controller;use Xu42\KuaiDi100\KuaiDi100;class TrackCode exte...原创 2018-07-26 16:07:31 · 1288 阅读 · 0 评论 -
TP5接入阿里云通信短信
主程序&amp;lt;?phpnamespace app\api\controller;// 来自官方require_once VENDOR_PATH . 'aliyun-dysms-php-sdk/api_sdk/vendor/autoload.php';use Aliyun\Api\Sms\Request\V20170525\SendSmsRequest;use Aliyun...原创 2018-07-26 15:56:44 · 1226 阅读 · 0 评论 -
微信公众号创建菜单目录数组结构
$data = [ 'button' =&gt; [ 0 =&gt; [ 'name' =&gt; '商城首页', 'url' =&gt; 'http://m.luhong421.com/Mobile/Index/lxx_test.html', ...原创 2018-07-26 11:34:25 · 701 阅读 · 0 评论 -
使用layUI流加载
前端&lt;ul id="flow_list"&gt;&lt;/ul&gt;&lt;script&gt; layui.use(['laypage', 'jquery', 'layer','flow'], function() { layui.flow.load({ elem: '#flow_list'原创 2018-07-28 16:11:47 · 1866 阅读 · 0 评论 -
ThinkPHP5.0.x事务提交
需要innodb类型的数据库表 例子:<?phpnamespace app\index\controller;use think\Db;class Index{ public function index() { Db::startTrans(); $check1 = Db::table('think_user...原创 2018-07-25 16:41:34 · 380 阅读 · 0 评论 -
centos7安装安装apache配置php-fpm
centos7安装安装apache配置php-fpm 安装apache(httpd),使用SCL源# 安装yum install httpd24# 查看服务名称systemctl list-unit-fileshttpd24-httpd.service# 启动,即可访问ip浏览systemctl start httpd24-httpd.service# 查看环境配置文件...原创 2018-09-17 12:23:43 · 2867 阅读 · 0 评论 -
centos7安装tengine配置php-fpm
centos7安装tengine 官网 github# 下载wget http://tengine.taobao.org/download/tengine-2.2.2.tar.gztar xvf tengine-2.2.2.tar.gzcd tengine-2.2.2# 编译环境yum -y install gcc gcc-c++ autoconf automak...原创 2018-09-17 15:34:24 · 1099 阅读 · 0 评论 -
安装pecl来管理安装php扩展
安装pecl来管理安装php扩展推荐阅读sublime使用 sublime-phpcs 插件# 前提已经安装php,下载wget http://pear.php.net/go-pear.phar# 初始化(使用自己的php路径)php go-pear.phar# 提示# XML Extension not found,开启xml扩展(像:sudo apt install php-...原创 2018-11-19 10:29:21 · 1278 阅读 · 1 评论 -
sublime格式化插件
下载github# 打开扩展文件夹# 安装git clone https://github.com/akalongman/sublimetext-codeformatter.git CodeFormatter配置重启sublime首选项Preferences -> 插件设置Package Setting -> CodeFormatter -> Setting...原创 2018-11-05 13:13:26 · 682 阅读 · 0 评论 -
sublime使用 sublime-phpcs 插件
linux版本sublime使用 sublime-phpcs 插件sublime-phpcs 插件手动安装官网github# [浏览插件]打开插件目录cd Sublime_Text/Packages/# 在目录里面下载sublime-phpcsgit clone git://github.com/benmatselby/sublime-phpcs.git Phpcsphar...原创 2018-11-05 12:55:34 · 514 阅读 · 0 评论 -
快充宝接入
快充宝&amp;lt;?phpnamespace app\index\controller;use think\Controller;use think\Db;class Miaochongbao extends Controller{ function return () { # 使用前提 # # 1、支付宝扫描给你的二维...原创 2018-11-07 12:17:06 · 580 阅读 · 0 评论 -
WDCP配置ThinkPHP伪静态隐藏index.php,解决重定向次数过多
修改文件项目入口文件# 把tp50项目public目录所有文件复制到public_html,修改index.php入口文件路径,所有的..修改为当前目录/配置nginx配置# 在wdcp里面,文件管理&gt;nginx配置(文件: /www/wdlinux/nginx/conf/vhost/feibao.xxx.com.conf,.wdcp结尾的不用修改),修改配置如下:# 注意...原创 2018-11-02 16:19:07 · 2567 阅读 · 0 评论 -
appnode不使用站点管理器,直接用nginx建站
配置tp5环境原文server { listen 80; server_name logo.lxx123.club; # 注意根目录的权限,否之403 root /vhs/www/phpzcool/public/; index index.html index.htm index.php; # 隐藏ind...原创 2018-11-02 13:39:39 · 1485 阅读 · 0 评论 -
php一般配置文件
禁用的函数pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, p...原创 2018-10-23 09:43:02 · 329 阅读 · 0 评论 -
windows子系统安装php
windows子系统安装php方案一(编译比较慢)编译安装可以先安装zsh,进入zsh之后更方便一些安装zsh设置# 查看版本cat /etc/issue# Ubuntu 16.04.4 LTS \n \l # 编辑源sudo nano /etc/apt/sources.list# 修改为deb http://mirrors.aliyun.com/ubuntu/ xen...原创 2018-09-22 13:42:43 · 520 阅读 · 0 评论 -
记录安装MixPHP框架
安装MixPHP安装 Swoole 扩展# pecl 在 php/bin 目录,国内 pecl 安装 swoole 有时很慢,如果无法忍受,可选择 编译安装。sudo /vhs/kangle/php/php71/bin/pecl install swoole# 不存在pecl,使用编译安装git clone https://gitee.com/swoole/swoole.git...原创 2018-09-27 09:31:07 · 954 阅读 · 0 评论 -
centos7手动安装php7
编译环境yum -y install gcc gcc-c++ libxml2 libxml2-devel bzip2 bzip2-devel libmcrypt libmcrypt-devel openssl openssl-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel readline readline...原创 2018-09-14 17:08:36 · 1318 阅读 · 0 评论 -
Linux(manjaro)安装PHP以及PHP扩展(redis)
Linux(manjaro)安装PHP以及PHP扩展(Reids) 直接安装php,默认是最高版本sudo pacman -S php php-cgi 查看php的安装目录位置[lxx@lxx-pc gitee]$ whereis phpphp: /usr/bin/php /usr/lib/php /etc/php /usr/include/php /usr/...原创 2018-07-24 13:08:58 · 1936 阅读 · 0 评论 -
城市名获取经纬度
public function GetADI($name = '') { $url = "http://api.map.baidu.com/geocoder?address=" . $name . "&output=json&key=37492c0ee6f924cb5e934fa08c6b1676"; $ch = curl_init();...原创 2018-07-06 12:48:25 · 371 阅读 · 0 评论 -
手记
<?php clss GetDataList { public function book_list() { # 获取分页的信息以及类型 $page = input('page');// 分页的页数默认是config的页数 if (Request::instance()->isPost()) { ...原创 2018-05-05 15:45:19 · 222 阅读 · 0 评论 -
php富文本标签转html格式化
$trans = array_flip(get_html_translation_table(HTML_ENTITIES)); $comtent = strtr($ret[0]['comtent'], $trans);原创 2018-04-24 21:34:49 · 2510 阅读 · 0 评论 -
省市县js联动
http://www.17sucai.com/preview/776331/2017-12-20/city/index.html原创 2018-04-24 21:34:03 · 812 阅读 · 0 评论 -
使用 PHPMailer 配合 QQ邮箱 发送邮件
// 开启php_openssl以及php_sockets&lt;?php/** * Created by PhpStorm. * Date: 2018/4/23 * Time: 23:14 */namespace app\common\sendingpay;use \think\Controller;use app\common\phpmailer\PHPMailer...原创 2018-04-24 00:18:25 · 377 阅读 · 0 评论 -
vscode php 开发使用插件技巧 更新中...
从sublime转到vscode的php开发者使用了大概3年的sublime,没有购买,有一段时间是使用的破解版,但是最近更新的破解不了了,在某一段时间使用过vscode,那时候是插件还很少,虽然是很顺手但是还算不上是高效的生产力工具,最近因为sublime频繁的弹窗以及插件sftp频繁报错,难以忍受,重新开始了我的vscode生涯,当一切的功能都有替代品,甚至比sub还要好,估计很难再转回去...原创 2018-04-30 19:50:02 · 7743 阅读 · 2 评论 -
php 使用 curl 模拟post请求,被请求端获取参数
请求:<?php$url = 'http://hhh.lxx123.club/post.php';$curl = curl_init();curl_setopt($curl, CURLOPT_URL, $url);curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($curl, CURLOPT_SSL...原创 2018-04-30 14:36:41 · 972 阅读 · 0 评论 -
H-ui.admin wellcome
{extend name="template/base" /} {block name="title"}我的桌面{/block} {block name="content"}<div class="page-container"> <p class="f-20 text-success">欢迎使用 {$Think.config.site.nam原创 2018-04-22 09:29:08 · 702 阅读 · 0 评论 -
thinkphp5 使用pjax 如果是pjax就局部,否则调用资源文件
使用pjax{php}\think\Request::instance()->isPjax()?'include APP_PATH."wap/view/pub/assetsnone.html";':include APP_PATH."wap/view/pub/assets.html"; {/php}原创 2018-03-24 11:43:36 · 1334 阅读 · 0 评论 -
thinkphp5 extend目录扩展类的使用
类所在路径:\extend\mikkle\tp_wxpay\WxPayConf_pub.php在其他类里面使用:use \mikkle\tp_wxpay\WxPayConf_pub as WxPayConf;as重新指定类名,便于实例化;在方法中使用:$wxpayconf= new WxPayConf();$wxpayconf->function();...原创 2018-03-13 21:08:46 · 7203 阅读 · 0 评论 -
ueditor数据库显示到前端使用转码
$ret = DB::connect('db_lite')->table('lxx_users')->where('id',7)->select(); $trans = array_flip(get_html_translation_table(HTML_ENTITIES)); $comtent = strtr($ret[0]['comtent']...原创 2018-03-18 13:19:13 · 638 阅读 · 0 评论 -
appnode node报错 Node.js Cannot find module 'xxx'
设置NODE_PATH全集变量环境#NODEPATHexport NODE_HOME=/root/.nvm/versions/node/v8.9.4export PATH=$NODE_HOME/bin:$PATHexport NODE_PATH=$NODE_HOME/lib/node_modules:$PATH重载source /etc/profile全局安装模块...原创 2018-03-18 09:08:00 · 973 阅读 · 0 评论 -
tpadmin合成推广二维码
合成推广二维码$img_url = $this->getCode("{$userId}"); $name = ROOT_PATH."/public/code/" . $this->get_random(); $code_filename = \File::downloadImage($img_url, $name);...原创 2018-03-15 12:28:46 · 253 阅读 · 0 评论 -
kangle 搭建tinkphp5 实践
使用KangLe搭建tp5环境1. 伪静态设置(?s=)[还是在根目录.htaccess]&lt;IfModule mod_rewrite.c&gt;Options +FollowSymlinks -MultiviewsRewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENA...原创 2018-06-04 23:23:46 · 754 阅读 · 0 评论