开发时常遇到的小问题

thinkphp where 不能为空表达:$ip['token'] = array('exp','is not null');

thinkphp  获取ip  $ip = get_client_ip();

if (/^1d{10}$/.test(phone))  js判断手机格式

visibility: hidden:将元素隐藏,但是在网页中该占的位置还是占着

strtotime("2011-07-01 11:1:1"):将日期格式转换成时间戳

required="required":请填写此字段

placeholder="收卡人称谓" : 默认值

Window.location.href="":打开新页面不跳转

onclick="return confirm('确定删除吗');"

{$v.title|msubstr=0,5,'utf-8',false}:thinkphp模板里截取中文字符串

multiple="multiple":select可多选

$(window).height() :jquery获取屏幕高度
window.innerWidth :js获取屏幕高度


var pro = $("#id").val();
$(this).val(pro.replace(/D|^0/g,''));jquery只允许输入数字

thinkphp 模板中截取字符串:{$data.title|mb_substr=###,0,18,'utf-8'}

 $where['ls_id'] = array('in',$res); thinkphp查询某个数在不在数组里

file_put_contents("./log.txt", json_encode($data),FILE_APPEND);  追加写入

隐藏select框下拉箭头:-webkit-appearance: none;

原文地址:https://www.cnblogs.com/rickons/p/4956123.html