php 格式化金钱
<?php
function priceFormat($price) {
$price_format = number_format($price,2,'.',' ');
return $price_format;
}
?>
<?php
function priceFormat($price) {
$price_format = number_format($price,2,'.',' ');
return $price_format;
}
?>
常见thinkphp设置404页面为建一个空控制器;里面然后通过_empty()再$this->display跳转到404页面;
thinkphp的配置项里面是有设置错误页面模板的:'TMPL_EXCEPTION_FILE' => APP_DEBUG ? THINK_PATH.'Tpl/think_exception.tpl' : './Template/default/Home/Public/404.html',
比较齐全的鼠标手型css
.auto { cursor: auto; }
.deafult { cursor: default; }
.none { cursor: none; }
.context-menu { cursor: context-menu; }
.help { cursor: help; }
.pointer { cursor: pointer; }
.progress { cursor: progress; }
.wait { cursor: wait; }
.cell { cursor: cell; }
.crosshair { cursor: crosshair; }
.text { cursor: text; }
.vertical-text { cursor: vertical-text; }
.alias { cursor: alias; }
.copy { cursor: copy; }
.move { cursor: move; }
.no-drop { cursor: no-drop; }
.not-allowed { cursor: not-allowed; }
.all-scroll { cursor: all-scroll; }
.col-resize { cursor: col-resize; }
.row-resize { cursor: row-resize; }
.n-resize { cursor: n-resize; }
.e-resize { cursor: e-resize; }
.s-resize { cursor: s-resize; }
.w-resize { cursor: w-resize; }
.ns-resize { cursor: ns-resize; }
.ew-resize { cursor: ew-resize; }
.ne-resize { cursor: ne-resize; }
.nw-resize { cursor: nw-resize; }
.se-resize { cursor: se-resize; }
.sw-resize { cursor: sw-resize; }
.nesw-resize { cursor: nesw-resize; }
.nwse-resize { cursor: nwse-resize; }
switch (0) {
case 'test1':
echo 1;
case 'test2':
echo 2;
case 'test3':
echo 3;
break;
}
结果输出123,因为在比较的时候;'test1'、'test2'、'test3'转成整型的结果都是0;
之前转载过webuploader的上传案例,今天在使用thinkphp上传时简单整合了下,整理代码以便后续使用,原文地址:https://www.r1989.com/note-670.html
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
vim /etc/ssh/sshd_config
//删除110行ClientAliveInterval 0 前面的注释#号 并改为ClientAliveInterval 540
//删除111行的lientAliveCountMax 3 前面的注释#号 并改为ClientAliveCountMax 10
设置为9分钟检测一次,最多超时10次,即一个半小时
service sshd reload;
/etc/init.d/sshd restart;
令恶意程序敬畏、用户喜爱的验证安全体系 - 极验滑动验证码
首先需要登录官网创建应用获取key,获取sdk导入
/ThinkPHP/Library/Org/Util/Geetest.class.php
sdk下载:gt-php-sdk-master.zip
在做名单分配的时候,做了一个功能,就是当勾选栏目,把所有的权限全勾上。之前写过类似的代码,直接复制到本项目中使用,发现第一次全选或取消时有效果,再次点击在源码中已添加checked属性,但是并不显示打勾状态。