随笔分类 -  PHP

上一页 1 ··· 10 11 12 13 14
I AM A PHPER
摘要:1. addslashes addslashes 返回字符串,该字符串为了数据库查询语句等的需要在某些字符前加上了反斜线。这些字符是单引号(')、双引号(")、反斜线(\)与 NUL(NULL 字符)。 一个使用 addslashes() 的例子是当你要往数据库中输入数据时。 例如,将名字 O're... 阅读全文
posted @ 2016-01-12 11:28 侠岚之弋痕夕 阅读(233) 评论(0) 推荐(0)
摘要:/si","",$str); //注释$str=preg_replace("//si","",$str); //过滤DOCTYPE$str=preg_replace("//si","",$str); //过滤html标签$str=preg_replace("//si","",$str); //过滤b... 阅读全文
posted @ 2016-01-08 16:13 侠岚之弋痕夕 阅读(213) 评论(0) 推荐(0)
摘要:$v) {// CSV的Excel支持GBK编码,一定要转换,否则乱码 $head[$i] = iconv('utf-8', 'gbk', $v);}// 将数据通过fputcsv写到文件句柄 fputcsv($fp, $head);// 计数器 $cnt = 0;// 每隔$limit行... 阅读全文
posted @ 2016-01-08 14:44 侠岚之弋痕夕 阅读(722) 评论(0) 推荐(0)
摘要:#测试网址: http://localhost/blog/testurl.php?id=5//获取域名或主机地址 echo $_SERVER['HTTP_HOST'].""; #localhost//获取网页地址 echo $_SERVER['PHP_SELF'].""; #/blog/te... 阅读全文
posted @ 2016-01-08 14:26 侠岚之弋痕夕 阅读(2565) 评论(0) 推荐(0)
摘要:提示:mb_substr在于php中是默认不被支持的我们需要在在windows目录下找到php.ini打开编辑,搜索mbstring.dll,找到;extension=php_mbstring.dll把前面的;号去掉才可以使用mb_substr函数哦。Function: mb_substr( $st... 阅读全文
posted @ 2016-01-07 17:10 侠岚之弋痕夕 阅读(243) 评论(0) 推荐(0)
摘要:1.猫头鹰后台登录:http://www.sucaihuo.com/templates/320.html 示例:http://www.sucaihuo.com/modals/3/320/demo/ 2.通用响应式登录:http://www.sucaihuo.com/templates/244.htm 阅读全文
posted @ 2016-01-05 17:05 侠岚之弋痕夕 阅读(356) 评论(0) 推荐(0)
摘要:根据IP定位城市:http://www.sucaihuo.com/js/35.html示例:http://www.sucaihuo.com/jquery/0/35/demo/ 阅读全文
posted @ 2016-01-05 16:27 侠岚之弋痕夕 阅读(165) 评论(0) 推荐(0)
摘要:项目中,可能用到额查看:http://www.sucaihuo.com/php/217.html 阅读全文
posted @ 2016-01-05 16:15 侠岚之弋痕夕 阅读(175) 评论(0) 推荐(0)
摘要:简单+使用!数据库的配置:config.php分页类的封装:page.class.phpmyde_total = $this->numeric($myde_total); $this->myde_size = $this->numeric($myde_size); $th... 阅读全文
posted @ 2016-01-05 16:12 侠岚之弋痕夕 阅读(213) 评论(0) 推荐(0)
摘要:很使用的php验证码示例: http://www.sucaihuo.com/js/91.html 示例: http://www.sucaihuo.com/jquery/0/91/demo/ 补充: http://www.sucaihuo.com/php/721.html http://www.suc 阅读全文
posted @ 2016-01-05 15:39 侠岚之弋痕夕 阅读(119) 评论(0) 推荐(0)
摘要:类PclZip.class.php下载:PclZip.rarcreate($files); if ($rs == 0) { die("Error : " . $zip->errorInfo(true)); }}function createReplaceZip($zip_u... 阅读全文
posted @ 2016-01-05 15:36 侠岚之弋痕夕 阅读(1316) 评论(0) 推荐(0)
摘要:Document 0) { switch ($_FILES["img"]["error"]) ... 阅读全文
posted @ 2016-01-05 13:55 侠岚之弋痕夕 阅读(312) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2016-01-04 14:47 侠岚之弋痕夕 阅读(14164) 评论(0) 推荐(0)
摘要:项目中经常使用到的验证,很使用的。查看与下载= $min) ? true : false; break; case 2: //只匹配最大值 return ($max >= $len) ? true : false; ... 阅读全文
posted @ 2015-12-29 13:48 侠岚之弋痕夕 阅读(678) 评论(0) 推荐(0)
摘要:如截图,preg_replace()的用法 与str_replace用法同,只是str_ireplace不区分大小写$str=str_ireplace("a"," ","abcabcAbca");其实,preg_replace与str_replace的用法大致差不多,preg_replace倾向于正... 阅读全文
posted @ 2015-12-23 13:21 侠岚之弋痕夕 阅读(286) 评论(0) 推荐(0)
摘要:清除HTML代码、空格、回车换行符的函数如下function DeleteHtml($str) { $str = trim($str); $str = strip_tags($str,""); $str = ereg_replace... 阅读全文
posted @ 2015-12-23 11:39 侠岚之弋痕夕 阅读(222) 评论(0) 推荐(0)
摘要:在实际项目很使用的函数,果断收集了function get_client_ip() { if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown")) $ip = getenv("H... 阅读全文
posted @ 2015-12-23 11:32 侠岚之弋痕夕 阅读(177) 评论(0) 推荐(0)
摘要:前提:要下载PHPEXCEL库文件 如:phpexcel官方下载 , 本人使用下载 情形一:对于将数据写入EXCEL表中的用法 header("content-type:text/html;charset=utf-8"); require "PHPEXCEL/Classes/PHPExcel.php 阅读全文
posted @ 2015-12-23 11:19 侠岚之弋痕夕 阅读(569) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2015-12-22 17:14 侠岚之弋痕夕 阅读(3) 评论(0) 推荐(0)

上一页 1 ··· 10 11 12 13 14
Where is the starting point, we don't have a choice, but the destination where we can pursue!