# 第二课常用函数
### 微擎常用不需要加载自带函数
```
<pre class="calibre14">```
写入cookie 过期时间秒<span class="token2">,</span><span class="token3">0</span>表示跟随浏览器<span class="token2">,</span><span class="token3">false</span><span class="token2">,</span>不允许js读取
<span class="token1">isetcookie</span><span class="token2">(</span>$key<span class="token2">,</span> $value<span class="token2">,</span> $expire <span class="token">=</span> <span class="token3">0</span><span class="token2">,</span> $httponly <span class="token">=</span> <span class="token3">false</span><span class="token2">)</span>
获取客户端IP
$ip <span class="token">=</span> <span class="token1">getip</span><span class="token2">(</span><span class="token2">)</span><span class="token2">;</span>
随机字符串<span class="token2">,</span><span class="token3">6</span>是长度<span class="token2">,</span><span class="token3">1</span>为是否数字<span class="token2">,</span>
<span class="token1">random</span><span class="token2">(</span><span class="token3">6</span><span class="token2">,</span><span class="token3">true</span><span class="token2">)</span><span class="token2">;</span>
获取表明
<span class="token1">tablename</span><span class="token2">(</span><span class="token4">'account'</span><span class="token2">)</span>
c、a、<span class="token5">do</span><span class="token2">,</span>a为<span class="token1">webapp</span><span class="token2">(</span>PC<span class="token2">)</span>、<span class="token1">wxapp</span><span class="token2">(</span>小程序<span class="token2">)</span> <span class="token1">site</span><span class="token2">(</span>公众号<span class="token2">)</span>
生成如下地址 <span class="token3">true</span>不带微信拼接字符<span class="token2">,</span>第二个<span class="token3">true</span>表示添加域名
<span class="token1">murl</span><span class="token2">(</span><span class="token4">'entry/site/fm'</span><span class="token2">,</span><span class="token2">[</span><span class="token4">'m'</span><span class="token">=</span><span class="token">></span><span class="token4">'yoby_test'</span><span class="token2">]</span><span class="token2">,</span><span class="token3">false</span><span class="token2">,</span><span class="token3">true</span><span class="token2">)</span>
一般手机端 $this<span class="token">-</span><span class="token">></span><span class="token1">createMobileUrl</span><span class="token2">(</span><span class="token4">'rank'</span><span class="token2">,</span><span class="token2">[</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span>
$this<span class="token">-</span><span class="token">></span><span class="token1">createWebUrl</span><span class="token2">(</span><span class="token4">'rank'</span><span class="token2">,</span><span class="token2">[</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span>
<span class="token1">wurl</span><span class="token2">(</span><span class="token4">'site/entry/rank'</span><span class="token2">,</span><span class="token2">[</span><span class="token4">'m'</span><span class="token">=</span><span class="token">></span><span class="token4">'yoby_test'</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span><span class="token6">//后台管理</span>
分页
<span class="token1">pagination</span><span class="token2">(</span>$total<span class="token2">,</span> $pageIndex<span class="token2">,</span> $pageSize <span class="token">=</span> <span class="token3">15</span><span class="token2">)</span><span class="token2">;</span>
返回媒体或图片路径
<span class="token1">tomedia</span><span class="token2">(</span>$src<span class="token2">)</span>
查找字符串
<span class="token1">strexists</span><span class="token2">(</span><span class="token4">'helloworld'</span><span class="token2">,</span> <span class="token4">'h'</span><span class="token2">)</span><span class="token2">;</span>
截取字符串
<span class="token1">cutstr</span><span class="token2">(</span>$string<span class="token2">,</span>$length<span class="token2">,</span> TRUE<span class="token2">,</span><span class="token4">'utf-8'</span><span class="token2">)</span><span class="token2">;</span>
计算字符串长度<span class="token2">,</span>中英文都为<span class="token3">1</span>
<span class="token1">istrlen</span><span class="token2">(</span><span class="token4">'hello-微擎'</span><span class="token2">)</span><span class="token2">;</span>
字符串加密或解密<span class="token2">,</span>默认解密<span class="token2">,</span>ENCODE加密<span class="token2">,</span>key秘钥<span class="token2">,</span><span class="token3">0</span>过期时间
<span class="token1">authcode</span><span class="token2">(</span>$string<span class="token2">,</span> $operation <span class="token">=</span> <span class="token4">'DECODE'</span><span class="token2">,</span> $key <span class="token">=</span> <span class="token4">''</span><span class="token2">,</span> $expiry <span class="token">=</span> <span class="token3">0</span><span class="token2">)</span>
<span class="token1">emoji_unicode_decode</span><span class="token2">(</span><span class="token2">)</span>emoji_unicode_encode 解码emoji
<span class="token1">get_first_pinyin</span><span class="token2">(</span>$str<span class="token2">)</span>拼音首字母
ihtml_entity_decode 显示html
array2xml xml2array xml数组互换
```
```
web默认加载,微信端也有以下函数
```
<pre class="calibre14">```
第二个参数为空<span class="token2">,</span>不跳转<span class="token2">,</span>warning警告<span class="token2">,</span>error错误<span class="token2">,</span>info提示<span class="token2">,</span>ajax
<span class="token1">message</span><span class="token2">(</span><span class="token4">'成功'</span><span class="token2">,</span> <span class="token1">referer</span><span class="token2">(</span><span class="token2">)</span><span class="token2">,</span> <span class="token4">'success'</span><span class="token2">)</span><span class="token2">;</span>
ajax 返回 <span class="token2">{</span><span class="token4">"message"</span><span class="token2">:</span><span class="token4">"\u6210\u529f"</span><span class="token2">,</span><span class="token4">"redirect"</span><span class="token2">:</span><span class="token4">""</span><span class="token2">,</span><span class="token4">"type"</span><span class="token2">:</span><span class="token4">"ajax"</span><span class="token2">}</span>
模板加载
<span class="token1">template</span><span class="token2">(</span><span class="token4">'common/template'</span><span class="token2">)</span><span class="token2">;</span>
<span class="token1">iajax</span><span class="token2">(</span>code<span class="token2">,</span>message<span class="token2">,</span>redirect<span class="token2">)</span><span class="token2">;</span>参数<span class="token3">2</span>支持数组或字符串
<span class="token1">itoast</span><span class="token2">(</span><span class="token4">"配置保存成功"</span><span class="token2">,</span> <span class="token1">referer</span><span class="token2">(</span><span class="token2">)</span><span class="token2">,</span> <span class="token4">'success'</span><span class="token2">)</span><span class="token2">;</span>
```
```
### 文件操作函数
```
<pre class="calibre14">```
<span class="token1">load</span><span class="token2">(</span><span class="token2">)</span><span class="token">-</span><span class="token">></span><span class="token1">func</span><span class="token2">(</span><span class="token4">'file'</span><span class="token2">)</span><span class="token2">;</span>
<span class="token1">file_copy</span><span class="token2">(</span>IA_ROOT <span class="token2">.</span> <span class="token4">'/web'</span><span class="token2">,</span> IA_ROOT <span class="token2">.</span> <span class="token4">'/data'</span><span class="token2">,</span> <span class="token1">array</span><span class="token2">(</span><span class="token4">'php'</span><span class="token2">)</span><span class="token2">)</span> 文件复制 过滤php
<span class="token1">file_delete</span><span class="token2">(</span><span class="token4">'test.png'</span><span class="token2">)</span><span class="token2">;</span>
<span class="token1">file_image_crop</span><span class="token2">(</span>IA_ROOT <span class="token2">.</span> <span class="token4">'/test.png'</span><span class="token2">,</span> IA_ROOT <span class="token2">.</span> <span class="token4">'/test2.png'</span><span class="token2">,</span> <span class="token3">50</span><span class="token2">,</span> <span class="token3">50</span><span class="token2">)</span><span class="token2">;</span> 剪切
<span class="token1">file_image_thumb</span><span class="token2">(</span>IA_ROOT <span class="token2">.</span> <span class="token4">'/test.png'</span><span class="token2">,</span> IA_ROOT <span class="token2">.</span> <span class="token4">'/test2.png'</span><span class="token2">,</span> <span class="token3">500</span><span class="token2">)</span><span class="token2">;</span> 生成缩率图 最后是宽
<span class="token1">file_move</span><span class="token2">(</span>IA_ROOT <span class="token2">.</span> <span class="token4">'/test.log'</span><span class="token2">,</span> IA_ROOT <span class="token2">.</span> <span class="token4">'/web/test.log'</span><span class="token2">)</span><span class="token2">;</span>文件移动
<span class="token1">file_upload</span><span class="token2">(</span>$_FILE<span class="token2">[</span><span class="token4">'test'</span><span class="token2">]</span><span class="token2">,</span> <span class="token4">'image'</span><span class="token2">,</span> <span class="token4">'test.png'</span><span class="token2">)</span><span class="token2">;</span> 上传
<span class="token1">file_write</span><span class="token2">(</span>IA_ROOT <span class="token2">.</span> <span class="token4">'/test.log'</span><span class="token2">,</span> <span class="token4">'hello-world'</span><span class="token2">)</span><span class="token2">;</span>文件写入
<span class="token1">mkdirs</span><span class="token2">(</span>IA_ROOT <span class="token2">.</span> <span class="token4">'/web/hello/world/example'</span><span class="token2">)</span><span class="token2">;</span>创建目录
file_remote_delete远程删除
写入远程
$filename <span class="token">=</span><span class="token4">"images/$weid/yoby_tougao_"</span><span class="token2">.</span>$snid<span class="token2">.</span><span class="token4">'.jpg'</span><span class="token2">;</span>
<span class="token1">file_write</span><span class="token2">(</span>$filename<span class="token2">,</span> $data<span class="token2">)</span><span class="token2">;</span>
<span class="token5">if</span> <span class="token2">(</span><span class="token">!</span><span class="token1">empty</span><span class="token2">(</span>$_W<span class="token2">[</span><span class="token4">'setting'</span><span class="token2">]</span><span class="token2">[</span><span class="token4">'remote'</span><span class="token2">]</span><span class="token2">[</span><span class="token4">'type'</span><span class="token2">]</span><span class="token2">)</span><span class="token2">)</span> <span class="token2">{</span> <span class="token6">// 判断系统是否开启了远程附件</span>
$remotestatus <span class="token">=</span> <span class="token1">file_remote_upload</span><span class="token2">(</span>$filename<span class="token2">)</span><span class="token2">;</span> <span class="token6">//上传图片到远程</span>
<span class="token5">if</span> <span class="token2">(</span><span class="token1">is_error</span><span class="token2">(</span>$remotestatus<span class="token2">)</span><span class="token2">)</span> <span class="token2">{</span>
<span class="token1">message</span><span class="token2">(</span><span class="token4">'远程附件上传失败,请检查配置并重新上传'</span><span class="token2">)</span> <span class="token2">;</span>
<span class="token2">}</span>
<span class="token2">}</span>
```
```
### http操作函数
```
<pre class="calibre14">```
<span class="token1">load</span><span class="token2">(</span><span class="token2">)</span><span class="token">-</span><span class="token">></span><span class="token1">func</span><span class="token2">(</span><span class="token4">'communication'</span><span class="token2">)</span><span class="token2">;</span>
$result <span class="token">=</span> <span class="token1">ihttp_get</span><span class="token2">(</span><span class="token4">'http://x.com'</span><span class="token2">)</span><span class="token2">[</span><span class="token4">'content'</span><span class="token2">]</span><span class="token2">;</span>
文件上传@<span class="token">+</span>绝对路径
$result <span class="token">=</span> <span class="token1">ihttp_post</span><span class="token2">(</span><span class="token4">'https://www.baidu.com'</span><span class="token2">,</span> <span class="token1">array</span><span class="token2">(</span><span class="token4">'username'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'we7'</span><span class="token2">)</span><span class="token2">)</span><span class="token2">;</span>
高级请求<span class="token2">,</span>第三个参数附加传入
<span class="token1">ihttp_request</span><span class="token2">(</span>$url<span class="token2">,</span> $post <span class="token">=</span> <span class="token4">''</span><span class="token2">,</span> $extra <span class="token">=</span> <span class="token1">array</span><span class="token2">(</span><span class="token2">)</span><span class="token2">,</span> $timeout <span class="token">=</span> <span class="token3">60</span><span class="token2">)</span>
```
```
记录日志
```
<pre class="calibre14">```
<span class="token1">load</span><span class="token2">(</span><span class="token2">)</span><span class="token">-</span><span class="token">></span><span class="token1">func</span><span class="token2">(</span><span class="token4">'logging'</span><span class="token2">)</span><span class="token2">;</span>
<span class="token1">logging_run</span><span class="token2">(</span><span class="token4">'记录字符串日志数据'</span><span class="token2">)</span><span class="token2">;</span>
<span class="token1">logging_run</span><span class="token2">(</span><span class="token2">[</span><span class="token3">1</span><span class="token2">,</span><span class="token3">2</span><span class="token2">,</span><span class="token3">3</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span>
```
```
用户中心
```
<pre class="calibre14">```
<span class="token1">load</span><span class="token2">(</span><span class="token2">)</span><span class="token">-</span><span class="token">></span><span class="token1">model</span><span class="token2">(</span><span class="token4">'mc'</span><span class="token2">)</span><span class="token2">;</span>
检测是否登录<span class="token2">,</span>没登陆跳到登陆
<span class="token1">checkauth</span><span class="token2">(</span><span class="token2">)</span><span class="token2">;</span>用于微信端 <span class="token1">checklogin</span><span class="token2">(</span><span class="token2">)</span>用于web
openid转换uid
$uid <span class="token">=</span> $_W<span class="token2">[</span><span class="token4">'member'</span><span class="token2">]</span><span class="token2">[</span><span class="token4">'uid'</span><span class="token2">]</span><span class="token2">;</span>
Array
<span class="token2">(</span>
<span class="token2">[</span>uid<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">10128</span>
<span class="token2">[</span>realname<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 用户昵称
<span class="token2">[</span>mobile<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 手机号码
<span class="token2">[</span>email<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 邮箱
<span class="token2">[</span>groupid<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 用户组ID
<span class="token2">[</span>groupname<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 用户组名称
<span class="token2">[</span>credit1<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 积分
<span class="token2">[</span>credit2<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 余额
<span class="token2">[</span>credit3<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 其它积分
<span class="token2">[</span>credit4<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 其它积分
<span class="token2">[</span>credit5<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 其它积分
<span class="token2">[</span>credit6<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 其它积分
<span class="token2">)</span>
$uid <span class="token">=</span> <span class="token1">mc_openid2uid</span><span class="token2">(</span>$openid<span class="token2">)</span><span class="token2">;</span>
$openid <span class="token">=</span> <span class="token1">mc_uid2openid</span><span class="token2">(</span>$uid<span class="token2">)</span><span class="token2">;</span>
<span class="token1">mc_credit_update</span><span class="token2">(</span>$uid<span class="token2">,</span><span class="token4">'credit2'</span><span class="token2">,</span> <span class="token">-</span><span class="token3">10</span><span class="token2">,</span><span class="token2">[</span>$uid<span class="token2">,</span><span class="token4">'测试减少10积分'</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span><span class="token6">//增减积分</span>
$num <span class="token">=</span> <span class="token1">mc_credit_fetch</span><span class="token2">(</span>$uid<span class="token2">,</span><span class="token2">[</span><span class="token4">'credit2'</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span><span class="token6">//查询积分</span>
积分通知
<span class="token1">mc_notice_credit1</span><span class="token2">(</span>$openid<span class="token2">,</span> $uid<span class="token2">,</span> <span class="token3">10</span><span class="token2">,</span> <span class="token4">'充值积分到账10分'</span><span class="token2">,</span> $url <span class="token">=</span> <span class="token4">'http://w.cn'</span><span class="token2">,</span> $remark <span class="token">=</span> <span class="token4">'谢谢惠顾,点击查看详情'</span><span class="token2">)</span><span class="token2">;</span>
弹出填写信息
<span class="token1">mc_require</span><span class="token2">(</span>$openid<span class="token2">,</span><span class="token2">[</span><span class="token4">'realname'</span><span class="token2">,</span> <span class="token4">'mobile'</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span>
更新填写信息
<span class="token1">mc_update</span><span class="token2">(</span>$openid<span class="token2">,</span><span class="token2">[</span><span class="token4">'email'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'test@163.com'</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span>
查询用户信息uid<span class="token2">,</span>返回字段
<span class="token1">mc_fansinfo</span><span class="token2">(</span>$uidoropenid<span class="token2">)</span>
Oauth获取用户信息
<span class="token1">mc_oauth_userinfo</span><span class="token2">(</span>$acid<span class="token2">)</span>
通过openid获取
<span class="token1">mc_oauth_fans</span><span class="token2">(</span>$openid<span class="token2">)</span>
查询用户信息
<span class="token1">mc_fetch</span><span class="token2">(</span>$uid<span class="token">/</span>openid<span class="token2">,</span><span class="token2">[</span><span class="token2">]</span><span class="token2">)</span>返回字段
uid<span class="token2">,</span>mobile<span class="token2">,</span>credit1积分<span class="token2">,</span>credit2余额<span class="token2">,</span>realname<span class="token2">,</span>nickname<span class="token2">,</span>avatar<span class="token2">,</span>gender <span class="token3">1</span>男<span class="token3">2</span>女<span class="token2">,</span>residecity市
```
```
自定义函数
```
<pre class="calibre14">```
微信中做了base64的加密字符串解密<span class="token2">,</span>解密之前不需要base64解密
<span class="token1">openssl_decrypt</span><span class="token2">(</span>$wechat_data<span class="token2">[</span><span class="token4">'req_info'</span><span class="token2">]</span><span class="token2">,</span> <span class="token4">"AES-256-ECB"</span><span class="token2">,</span> <span class="token1">md5</span><span class="token2">(</span><span class="token4">'appid'</span><span class="token2">)</span><span class="token2">)</span><span class="token2">;</span>
serialize unserialize 序列化
<span class="token1">extract</span><span class="token2">(</span>$arr<span class="token2">)</span><span class="token2">;</span><span class="token1">compact</span><span class="token2">(</span><span class="token4">'a'</span><span class="token2">,</span><span class="token4">'b'</span><span class="token2">,</span><span class="token4">'c'</span><span class="token2">,</span><span class="token4">'d'</span><span class="token2">,</span><span class="token4">'i'</span><span class="token2">)</span><span class="token2">;</span>解码成字符串
<span class="token1">explode</span><span class="token2">(</span><span class="token4">'-'</span><span class="token2">,</span><span class="token4">'1-2-3-4'</span><span class="token2">)</span><span class="token2">;</span><span class="token6">//分割成数组</span>
<span class="token1">implode</span><span class="token2">(</span><span class="token4">'-'</span><span class="token2">,</span>$arr<span class="token2">)</span><span class="token2">;</span><span class="token6">//转换成字符串</span>
<span class="token1">mb_convert_encoding</span><span class="token2">(</span><span class="token4">'李太白'</span><span class="token2">,</span><span class="token4">"utf-8"</span><span class="token2">,</span><span class="token4">'auto'</span><span class="token2">)</span><span class="token2">;</span>自动转换成uft8
<span class="token1">foreach</span><span class="token2">(</span>$list as <span class="token">&</span>$row<span class="token2">)</span><span class="token2">{</span>
处理数据
<span class="token2">}</span>
<span class="token1">unset</span><span class="token2">(</span>$row<span class="token2">)</span><span class="token2">;</span>
```
```
支付几种返回
```
<pre class="calibre16">```
$wechat <span class="token">=</span> <span class="token1">uni_setting</span><span class="token2">(</span><span class="token3">1</span><span class="token2">,</span> <span class="token1">array</span><span class="token2">(</span><span class="token4">'payment'</span><span class="token2">)</span><span class="token2">)</span><span class="token2">;</span>
借用返回
Array
<span class="token2">(</span>
<span class="token2">[</span>payment<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token2">(</span>
<span class="token2">[</span>credit<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token2">(</span>
<span class="token2">[</span>switch<span class="token2">]</span> <span class="token">=</span><span class="token">></span>
<span class="token2">)</span>
<span class="token2">[</span>alipay<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token2">(</span>
<span class="token2">[</span>switch<span class="token2">]</span> <span class="token">=</span><span class="token">></span>
<span class="token2">[</span>account<span class="token2">]</span> <span class="token">=</span><span class="token">></span>
<span class="token2">[</span>partner<span class="token2">]</span> <span class="token">=</span><span class="token">></span>
<span class="token2">[</span>secret<span class="token2">]</span> <span class="token">=</span><span class="token">></span>
<span class="token2">)</span>
<span class="token2">[</span>wechat<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token2">(</span>
<span class="token2">[</span>switch<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">2</span>
<span class="token2">[</span>account<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">1</span>
<span class="token2">[</span>signkey<span class="token2">]</span> <span class="token">=</span><span class="token">></span>
<span class="token2">[</span>partner<span class="token2">]</span> <span class="token">=</span><span class="token">></span>
<span class="token2">[</span>key<span class="token2">]</span> <span class="token">=</span><span class="token">></span>
<span class="token2">[</span>borrow<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">2</span>
<span class="token2">)</span>
<span class="token2">[</span>delivery<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token2">(</span>
<span class="token2">[</span>switch<span class="token2">]</span> <span class="token">=</span><span class="token">></span>
<span class="token2">)</span>
<span class="token2">)</span>
<span class="token2">)</span>
本身返回
Array
<span class="token2">(</span>
<span class="token2">[</span>payment<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token2">(</span>
<span class="token2">[</span>wechat<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token2">(</span>
<span class="token2">[</span>switch<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">1</span>
<span class="token2">[</span>version<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">2</span>
<span class="token2">[</span>apikey<span class="token2">]</span> <span class="token">=</span><span class="token">></span> J8BNZ88rR8hhHH9Z7bqhbB57HbQOp3F9
<span class="token2">[</span>mchid<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">1493418902</span>
<span class="token2">[</span>account<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">2</span>
<span class="token2">[</span>signkey<span class="token2">]</span> <span class="token">=</span><span class="token">></span> J8BNZ88rR8hhHH9Z7bqhbB57HbQOp3F9
<span class="token2">)</span>
<span class="token2">)</span>
<span class="token2">)</span>
非支付id返回
Array
<span class="token2">(</span>
<span class="token2">[</span>payment<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token2">(</span>
<span class="token2">[</span>wechat<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array
<span class="token2">(</span>
<span class="token2">[</span>switch<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">2</span>
<span class="token2">[</span>borrow<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">2</span>
<span class="token2">[</span>account<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">3</span>
<span class="token2">[</span>signkey<span class="token2">]</span> <span class="token">=</span><span class="token">></span>
<span class="token2">)</span>
<span class="token2">)</span>
<span class="token2">)</span>
```
```
- 简介
- 第一章 数据库
- Mysql/mariadb
- 函数
- 基础
- 增删改索引
- 标准查询
- 高级查询
- TIDB集群mysql解决方案
- Redis
- 语言基础
- 5种数据类型
- 其他类型
- Sqlite
- 语言基础
- 常用查询
- 第二章 PHP
- 语言基础
- 第一课 流程控制和运算
- 第二课 数组
- 第三课 日期时间
- 第四课 常用函数
- 第五课 字符串
- 第六课 文件操作
- 第七课 面向对象
- 第八课 正则表达式
- 第九课 图片处理生成
- 第十课 curl/memche
- 第十一课 mysql和pdo
- 第十三课 cookie和session
- 第十四课 xml操作
- 第十五课 php5.3+新特性
- 第十六课 php7+
- 第十七课 密码安全
- 废弃函数
- php命令行
- redis应用
- 算法
- 排序算法
- 基础算法
- 无限级分类
- 自定义函数Fn
- 查找算法
- 自定义函数数据函数fn
- laravel
- 路由
- 常用语句
- 数据库
- dingo/api
- Yii2
- 控制器
- 常用类
- 数据库
- redis
- thinkphp6
- TP6文档
- TP6插件
- dedecms
- 织梦标签大全
- 数据库操作
- 内置函数和定义函数
- 织梦核心改动
- 织梦插件/底层标签开发
- PHP相关工具
- composer
- php开发环境phpenv
- Phpstorm使用
- windows编译php扩展
- PHP开源库
- 开源项目管理禅道
- sns_auth
- php-casbin权限控制
- php-jwt
- 微信SDKeasywechat
- querylist采集库
- workerman
- Box/Spout处理excel和csv
- dll扩展
- redis/memche/xdebug
- redis
- Lua
- php_xlswriter
- event
- swoole
- 常用代码库
- 微擎框架
- 第一课全局变量
- 第二课常用函数
- 第三课自定义微擎独有函数
- 第四课数据库操作
- 第五课微信端回复
- 第六课微擎高级操作
- 第八课global函数列表
- mainfest.xml详解
- js方法
- 人人商城
- 第一课model解读
- 第二课常用语句解读
- 第三课常用js解读
- 第四课附录常见问题
- 第五课附录处理报表|支付
- 常用JSON状态码
- 第三章 JavaScript
- js基础
- 浏览器对象
- 语言基础
- html5接口
- ES6新语法
- vue
- 基础语法
- 京东vueUI组件
- uniapp
- 组件开发规范
- nodejs
- 基础知识
- 安装node
- nvm不同版本node切换
- js常用标准库
- zepto/jquery
- weui
- js图标库
- elementUI
- validator表单验证
- layer弹出层
- requirejs
- wow动画
- 动画animate
- swiper4
- 百度编辑器
- flyio/axios/qs
- jquery.form
- bootstrap3
- clipboard复制
- slideout侧滑
- imagehover.css图片悬停动画
- webpack打包
- Bulma UI框架
- store 客户端存储
- lottie动画创建库
- sweetalert
- js自定义函数
- 常见JSSDK
- 微信公众号JSSDK
- 腾讯地图jssdk
- 微信小程序
- 第四章 编程语言
- markdown语言
- Dart语言
- Dart语言基础
- Flutter框架
- Lua语言
- 字符串,数组,表
- 自定义方法
- go语言
- 第1.1语言基本语法
- 第1.2流程控制
- 第1.3函数
- 第1.4结构体
- 第1.5接口
- 第1.6包
- go语言框架Gin
- CSS3语言
- CSS与CSS3
- 选择符
- 属性
- css3
- loading动画
- HTML5语言
- less
- sass
- C#
- 基础知识
- 函数
- 第五章 开发工具
- git
- nginx/apache服务器
- Linux常用操作
- crontab定时任务
- 注册表与cmd
- 阿里云ECS
- frp穿透和ssl续期
- 宝塔安装
- 树莓派
- 浏览器模拟
- 火狐/chrome常用插件
- WSL安装使用
- mac brew和终端命令
- win10相关