前端代码一看就懂的 官方地址http://jquery.malsup.com/form/ 点我下载jquery.form beforeSerialize: function($form, options) { // return false 阻止表单提交 } beforeSubmit: function(arr, $form, options) { &nbs…
前端代码一看就懂的 官方地址http://jquery.malsup.com/form/ 点我下载jquery.form beforeSerialize: function($form, options) { // return false 阻止表单提交 } beforeSubmit: function(arr, $form, options) { &nbs…
比php自带的var_dump和print更直观,容易看懂 function dump($var, $echo=true, $label=null, $strict=true) { $label = ($label === null) ? '' : rtrim($label) . ' '; if (!$strict) { if (ini_get('html_errors')) { $output = print_r($var, true); $output = "" . $label . htmlspecialch…
/** * 验证手机号是否正确 * @param INT $mobile */ function isMobile($mobile) { if (!is_numeric($mobile)) { return false; } return preg_match('#^13[\d]{9}$|^14[5,7]{1}\d{8}$|^15[^4]{1}\d{8}$|^17[0,6,7,8]{1}\d{8}$|^18[\d]{9}$#', $mobile) ? true : false; } /** * Thinkphp 3…
function getipinfo(){ header("Content-Type:text/html; charset=utf-8"); $url = 'http://1111.ip138.com/ic.asp'; //这儿填页面地址 $info=httpGet($url); $p = "%(.*?)%si"; preg_match_all($p, $info, $arr); $info=$arr[1]; $str1 = explode("[",iconv('GB2312', 'UTF-8',$info[0])…
thinkphp 获取数据集 和 获取单挑数据 list_to_tree 在导航等用的多 int_to_string将数字 转换为字符串 在一些 什么 男女 状态等地方用的多 方便 /* * 获取数据集 * */ function get_result($Model,$map=array(),$field='',$order='',$limit=0,$group='',$having=''){ if(is_string($Model)){ $Model = M($Model); } if($limit==0){ $…
1、添加地址栏地址 param($add=array(),$del='') $add会自动添加当前地址栏已有的条件 然后再添加自己加入的key val Del会删除填写的条件!! 以前把地址栏所有条件写在上面,蠢死咯,用法 ('要添加的键值对'),'要删除的key'))?> ; 2、截取字符串 自动添加标点 Msubstr($str,0,10) 0为开始 10为结束点 意思即为10个字 有超出省略 加省略号 3、数据库 积分…
function chineseFirst($str) { $str= iconv("UTF-8","gb2312", $str); //如果程序是gbk的,此行就要注释掉 //判断字符串是否全都是中文 if (preg_match("/^[\x7f-\xff]/", $str)) { $fchar=ord($str{0}); if($fchar>=ord("A") and $fchar<=ord("z") )return strtoupper($str{0}); $a = $str; $val=ord…
安装 淘宝镜像 npm install express --registry=https://registry.npm.taobao.org var app = require('http').createServer(handler), io = require('socket.io').listen(app), fs = require('fs')app.listen(808…
$User = M("User"); // 实例化User对象 $User->where('id=5')->setInc('score',3); // 用户的积分加3 $User->where('id=5')->setInc('score'); // 用户的积分加1 $User->where('id=5')-…
1、软件环境: Centos7、VMware 10.0、NodeJS v0.10.24 2、首先确认有nodejs编译及依赖相关软件,如果没有可通过运行以下命令安装。 [root@localhost sharing]# yum -y install gcc gcc-c++ openssl-devel 3、下载NodeJS源码包并解压。 [root@localhost sharing]#&nb…