诚然博客

  • 首页
  • HTML
  • Jquery
  • PHP
  • ThinkPHP
  • Linux
Jquery

jquery ajax异步上传表单插件 (文件+表单数据)--保存着

前端代码一看就懂的 官方地址http://jquery.malsup.com/form/ 点我下载jquery.form beforeSerialize: function($form, options) {     // return false 阻止表单提交 } beforeSubmit: function(arr, $form, options) {  &nbs…

2015年6月18日 2060点热度 诚然 阅读全文
PHP

php 优化var_dump 最好的输出函数 对浏览器友好 取自thinkphp

比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…

2015年6月16日 1946点热度 诚然 阅读全文
PHP

php 手机号验证 isMobile thinkphp 3.2 发邮件函数

/** * 验证手机号是否正确 * @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…

2015年6月3日 1978点热度 诚然 阅读全文
PHP

thinkphp 通过ip获取真实地址 取巧方法

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])…

2015年6月3日 1814点热度 诚然 阅读全文
PHP

Thinkphp 3.2 get_result get_info list_to_tree int_to_string

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){ $…

2015年6月3日 1869点热度 诚然 阅读全文

COPYRIGHT © 2012-现在 诚然博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

鄂ICP备2022012104号