前端代码一看就懂的 官方地址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){ $…