Where possible begins

希望你喜欢这里。有问题,请提问,或搜索现有帖子。

真诚、友善、团结、专业,共建你我引以为荣之社区。《常见问题解答》

子枫
子枫 [Rainy] 07-04 10:07

tp51验证码的使用

开发调优

<p>生成</p><pre class="brush:php;toolbar:false"> use&nbsp;think\captcha\Captcha; &nbsp;public&nbsp;function&nbsp;verify(){ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$config&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;[ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;验证码字体大小 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#39;fontSize&#39;&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;&nbsp;&nbsp;&nbsp;30,&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&n

243

子枫
子枫 [Rainy] 07-04 10:05

调用省市区联动

开发调优

<pre class="brush:php;toolbar:false"> public&nbsp;function&nbsp;change_select_json(){ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$type&nbsp;=&nbsp;input(&#39;type&#39;,&#39;&#39;); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$id&nbsp;=&nbsp;input(&#39;id&#39;,&#39;&#39;); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($type==1){ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$where[]&nbsp;=&nbsp;[&#39;province_num&#39;,&#39;=&#39;,$id]; &nbsp;&nbsp;&nb

234

子枫
子枫 [Rainy] 06-27 16:54

centos镜像下载

开发调优

<p>下载地址:&nbsp;&nbsp;<a href="http://archive.kernel.org/centos-vault/altarch/7.6.1810/isos/aarch64/" _src="http://archive.kernel.org/centos-vault/altarch/7.6.1810/isos/aarch64/">http://archive.kernel.org/centos-vault/altarch/7.6.1810/isos/aarch64/</a> </p><p><br/></p>

248

子枫
子枫 [Rainy] 06-27 13:19

给出一个日期,判断是否是某个节气,或某节气的后

开发调优

<pre class="brush:php;toolbar:false"> function&nbsp;getJieQi($_year,$month,$day)&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$year&nbsp;=&nbsp;substr($_year,-2)+0;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$coefficient&nbsp;=&nbsp;array(&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(5.4055,2019,-1),//小寒&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&

263

子枫
子枫 [Rainy] 06-13 15:01

哔哩哔哩视频av和bv互转 PHP源码

开发调优

<pre class="brush:php;toolbar:false"> class&nbsp;Bilibili{ &nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;$table&nbsp;=&nbsp;&quot;fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF&quot;; &nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;$tr&nbsp;=&nbsp;[]; &nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;$s&nbsp;=&nbsp;[11,&nbsp;10,&nbsp;3,&nbsp;8,&nbsp;4,&nbsp;6]; &nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;$xor&nbsp;=&nbsp;177451812; &nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;$add&nbsp;=&nbsp;8728348608; &nbsp;&nb

325

子枫
子枫 [Rainy] 06-09 12:01

mac使用npm安装包,报没有权限

开发调优

<p>执行代码</p><pre class="brush:php;toolbar:false">npm&nbsp;install&nbsp;-g&nbsp;yo&nbsp;generator-code</pre><p>时报错<br/></p><pre class="brush:php;toolbar:false">(base)&nbsp;zf@192&nbsp;test&nbsp;%&nbsp;npm&nbsp;install&nbsp;-g&nbsp;yo&nbsp;generator-code npm&nbsp;ERR!&nbsp;code&nbsp;EACCES npm&nbsp;ERR!&nbsp;syscall&nbsp;mkdir npm&nbsp;ERR!&nbsp;path&nbsp;/usr/local/lib/node_modules/generator-code npm&nbsp;ERR!&nbsp;errno&nbsp;-13 npm&nbsp;ERR!&nbsp;Error:&nbsp;EACCES:&nbsp;permission&nbsp;de

286

子枫
子枫 [Rainy] 06-08 16:11

shell 判断进程是否关闭,如果关闭,自动启用

开发调优

<pre class="brush:php;toolbar:false">#!&nbsp;/bin/bash nginx_procnum=`ps&nbsp;-ef&nbsp;|&nbsp;grep&nbsp;&quot;nginx&quot;&nbsp;|&nbsp;grep&nbsp;-v&nbsp;grep&nbsp;|&nbsp;wc&nbsp;-l` mysql_procnum=`ps&nbsp;-ef&nbsp;|&nbsp;grep&nbsp;&quot;mysqld&quot;&nbsp;|&nbsp;grep&nbsp;-v&nbsp;grep&nbsp;|&nbsp;wc&nbsp;-l` redis_procnum=`ps&nbsp;-ef&nbsp;|&nbsp;grep&nbsp;&quot;redis&quot;&nbsp;|&nbsp;grep&nbsp;-v&nbsp;grep&nbsp;|&nbsp;wc&nbsp;-l` memcached_procnum=`ps&nbsp;-ef&nbsp;|&nbsp;grep&nbsp;&quot;mem

230

子枫
子枫 [Rainy] 06-07 10:41

linux命令 set -ex 什么意思

开发调优

<p style="margin: 10px auto; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: medium; white-space: normal;">-e 脚本中的命令一旦运行失败就终止脚本的执行<br/>-x 用于显示出命令与其执行结果(默认shell脚本中只显示执行结果</p><p style="margin: 10px auto; font-family: &quot;PingFang SC&quot;, &quot;Microsoft YaHei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: medium; white-space: normal;">+ex表示不终止错误,不显示结果</p><p><br/></p>

301

子枫
子枫 [Rainy] 05-31 19:51

linux杀死进程命令kill

开发调优

<p>kill&nbsp; PID</p><p><br/></p>

294

子枫
子枫 [Rainy] 05-31 19:49

linux 查询占用的端口

开发调优

<p><span style="color: rgb(185, 189, 182); font-family: Monaco, Menlo, Consolas, &quot;Courier New&quot;, monospace; font-size: 13px; white-space: pre-wrap; background-color: rgb(27, 36, 38);">lsof -i:端口号</span></p>

250

子枫
子枫 [Rainy] 05-20 19:56

mysql 设置字段的默认值

开发调优

<p>设置表zf_user&nbsp; 的name字段的默认值为匿名<br/></p><pre class="brush:php;toolbar:false">ALTER&nbsp;TABLE&nbsp;zf_user&nbsp;ALTER&nbsp;COLUMN&nbsp;name&nbsp;SET&nbsp;DEFAULT&nbsp;&#39;匿名&#39;;</pre><p><br/></p>

235

子枫
子枫 [Rainy] 05-20 19:56

mysql 设置字段的默认值

开发调优

<p>设置表zf_user&nbsp; 的name字段的默认值为匿名<br/></p><pre class="brush:php;toolbar:false">ALTER&nbsp;TABLE&nbsp;zf_user&nbsp;ALTER&nbsp;COLUMN&nbsp;name&nbsp;SET&nbsp;DEFAULT&nbsp;&#39;匿名&#39;;</pre><p><br/></p>

241

子枫
子枫 [Rainy] 05-08 13:36

h5跳转到微信公众号关注页面

开发调优

<p><br/></p><p>扫码进入公众号</p><p>打开查看网页源代码</p><p>搜索找到</p><p><img src="http://oss1.wangmingchang.com/mac/MdImd/20220508133457.png" title="1651988088176048.png" alt="image.png" width="1003" height="427" style="width: 1003px; height: 427px;"/></p><p><br/></p><p>然后base64加密 这个数字&nbsp; 得到&nbsp;MzAxMzMxNjIxNA==</p><p>加入链接得到:&nbsp; &nbsp;<a href="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzAxMzMxNjIxNA==#wechat_redirect" _src="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzAxMzM

231

子枫
子枫 [Rainy] 04-30 21:09

js 字符和数组的转化

开发调优

<pre class="brush:php;toolbar:false"> &nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;array=&nbsp;[{111},{222},{333}]&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;//将数组对象转为字符串数组 &nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;arrayStr&nbsp;=&nbsp;JSON.stringify(array)&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;//将数组字符串转为数组对象 &nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;array&nbsp;=&nbsp;JSON.parse(arrayStr)</pre><p><br/></p>

244

子枫
子枫 [Rainy] 04-25 16:46

php验证邮箱

开发调优

<pre class="brush:php;toolbar:false">&nbsp;if&nbsp;(!filter_var($data[&#39;email&#39;],FILTER_VALIDATE_EMAIL))&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;jserror(&#39;Email&nbsp;address&nbsp;is&nbsp;incorrect.&nbsp;&#39;); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre><p><br/></p>

237