原创 tp5 隨機獲取商品

/** * 隨機獲取商品 */ public function getRandGoods(){ $map['status'] = 1; //狀態;上架 $map

原创 ecshop pc微信掃碼支付

1.微信支付sdk       Wxpay.php <?php require_once "wxpay/lib/WxPay.Api.php"; require_once 'wxpay/lib/MyWxPay.Config.ph

原创 linux安裝redis

安裝: 1.獲取redis資源   wget http://download.redis.io/releases/redis-4.0.8.tar.gz    2.解壓   tar xzvf redis-4.0.8.tar.gz  

原创 php微信 - 4微信get方法測試簡單封裝

<?php $wechatObj = new wechatCallAPI(); $getUrl = 'https://api.weixin.qq.com/cgi-bin/getcallbackip?access_token='.

原创 linux wdcp連接sqlsever

1.安裝FreeTDSwget ftp://ftp.freetds.org/pub/freetds/stable/freetds-patched.tar.gz tar -zxvf freetds-patched.tar.gz ll

原创 tp5 session_id 跨域

<?php namespace app\appApi\controller; header('Access-Control-Allow-Origin: *'); header("Access-Control-Allow-Headers:

原创 小程序-循環遍利數據

school.js Page({ data:{ arr: [ { "id": "1001", "school": "廣州XXX1001學院"

原创 php微信 - 7curl get 和post封裝

封裝curl public function http_curl($url, $type = 'get', $res = 'json', $arr = ''){ $cl = curl_init(); cu

原创 ob_flush(); flush(); 1-100顯示

<div id="notice"></div>   <script type="text/javascript">   function shownum(width) {       document.g

原创 redis wdcp v3.2 php擴展安裝

1.下載解壓develop wget https://github.com/phpredis/phpredis/archive/develop.zip unzip develop.zip cd phpredis-develop/

原创 thinkphp模糊查詢

public function searchclass($arrset,$pagesize,$offset){ $keyword = isset($arrset['keyword']) ? htmlentitie

原创 php微信 - 2獲取AccessToken

獲取AccessToken <?php $wechatObj = new wechatCallAPI(); $wechatObj ->getAccessToken(); class wechatCallAPI {

原创 ip判斷國家

1. 下載數據庫和 PHP 庫文件下載 GeoID.dat.gz, 解壓爲 GeoIP.dat 文件. http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/

原创 php微信 - 9sprintf注意事項

$textTpl = " <xml> <ToUserName><![CDATA[%s]]></ToUserName> <Fro

原创 php微信 - 6自動回覆

自動回覆 public function getpost() { //獲取用戶傳送過來的xml $postStr = $GLOBALS["HTTP_RAW_POST_DATA"];