- 博客(236)
- 资源 (21)
- 收藏
- 关注
原创 PHP 关于PHP生成PDF的一些文档资料
http://www.fpdf.org/FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to saywithout using the PDFlib library. F from FPDF stands for Free: you may use it for any kindof
2015-03-31 17:44:45
688
原创 把自己的功能某块,嵌入到其他PHP项目当中
//根目录index.phprequire_once('api.php');$api = new Api();$api->newTest();api.phpif( !defined('PHPMODULE_BASE_PATH')){ define('PHPMODULE_BASE_PATH',str_replace('\\','/',dirname(__FILE__)
2015-03-27 16:21:53
988
原创 PHP生成word文档,表格实例
<?phprequire_once 'PHPWord.php';// New Word Document$PHPWord = new PHPWord();// New portrait section$section = $PHPWord->createSection();$PHPWord->addFontStyle('rStyle', array('bold'=>true,'co
2015-03-27 13:42:51
6059
原创 jQuery-FullScreen jquery插件
代码下载地址 https://github.com/martinaglv/jQuery-FullScreen说明文档https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
2015-03-26 13:45:37
1531
转载 Javascript keyCode对照表
字母和数字键的键码值(keyCode)按键键码按键键码按键键码按键键码A65J74S83149B66K75T84250C67L76U85351D68M77V86452E69N7
2015-03-26 13:17:07
442
原创 PHP加密数据操作类
class PHPMcrypt{/* 操作句柄 */private $crypt = null;/* 生成的密钥 */private $key = null;/* 初始向量 */private $iv = null;/* 支持的最长密钥 */private $ks = null; public function __construct($secretKey='!@#$%^'){
2015-02-05 16:19:08
626
原创 PHP把一个指定的数,随机的分配到指定书目的数组中
$num = 10;$total = 50;$array = array();$array = array_pad($array,$num,0);function randArray($num,$total,$array){ for($i=0;;$i++){ for($j=0;$j<$num;$j++){ $rand = rand(0,1); if( (array_sum($
2015-01-27 17:36:10
1701
原创 jquery 弹出框居中显示
弹出确认框始终位于窗口的中间位置的测试.mask { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #ffffff; opacity: 0.1; filter: alpha(opacity=10); z-index: 99; }.mess { position: absolute; widt
2015-01-21 23:30:19
1323
原创 PHP ZIP扩展操作类文件
class PHPZip{private $zip = null;public function __construct(){ $this->zip=new ZipArchive();}private function addFileToZip($path){ //打开当前文件夹由$path指定。 $handler=opendir($path); while(($filena
2015-01-19 17:29:51
959
原创 PHP操作办公软件文件 word,powerpoint,excel
wordhttp://phpword.codeplex.com/powerpointhttp://phppowerpoint.codeplex.com/excelhttp://phpexcel.codeplex.com/
2015-01-13 17:45:14
648
原创 PHP excel操作记录
PHPExcelhttp://phpexcel.codeplex.com/https://github.com/PHPOffice/PHPExcel文档内容http://blog.youkuaiyun.com/liuxinmingcode/article/details/8104604phpexcelreaderhttp://sourceforge.net/projec
2015-01-13 15:16:51
555
原创 jquery插件fullPage.js完成全屏效果
官网http://alvarotrigo.com/fullPage/#githubhttps://github.com/alvarotrigo/fullPage.js特殊特效地址http://www.dowebok.com/77.htmlhttp://www.dowebok.com/demo/2014/77/
2015-01-12 14:07:58
647
原创 ReflectionMethod执行类中的方法
class HelloWorld { public function sayHelloTo($name) { return 'Hello ' . $name; }}$reflectionMethod = new ReflectionMethod('HelloWorld', 'sayHelloTo');echo $reflectionMethod->invo
2014-12-31 16:02:23
1466
转载 PHP反射机制实现动态代理的代码
演示用代码如下所示:<?phpclass ClassOne {function callClassOne() {print "In Class One";}}class ClassOneDelegator {private $targets;function __construct() {$this->target[] = new ClassOne();}function
2014-12-31 15:18:24
932
原创 curl请求方法
/** * 发送HTTP请求方法,目前只支持CURL发送请求 * @param string $url 请求URL * @param array $params 请求参数 * @param string $method 请求方法GET/POST * @return array $data 响应数据 */function http($url, $params, $m
2014-12-31 14:53:55
1302
原创 PHP加密解密函数
/** * 系统加密方法 * @param string $data 要加密的字符串 * @param string $key 加密密钥 * @param int $expire 过期时间 单位 秒 * @return string * @author winky */function encrypt($data, $key = '', $expire = 0)
2014-12-31 14:19:38
655
原创 PHP对象在内存中的分配
对像在PHP 里面和整型、浮点型一样,也是一种数据类,都是存储不同类型数据用的, 在运行的时候都要加载到内存中去用,那么对象在内存里面是怎么体现的呢?内存从逻辑上 说大体上是分为4 段,栈空间段、堆空间段、代码段、初始化静态段,程序里面不同的声明 放在不同的内存段里面,数据段(data segment)通常是指用来存放程序中已初始化且不为0的全局变量如:静态变量和常量;代码段(code segme
2014-12-22 16:07:57
633
转载 Apache的两种工作模式
Apache服务的两种工作模式:prefork和workerprefork的工作原理及配置 1)工作原理: 一个单独的控制进程(父进程)负责产生子进程,这些子进程用于监听请求并作出应答。Apache总是试图保持一些备用的 (spare)或是空闲的子进程用于迎接即将到来的请求。这样客户端就无需在得到服务前等候子进程的产生。在Unix系统中,父进程通常以root身份
2014-12-19 14:14:24
718
转载 一个服务器下面配置多个网站
如有两个域名,分别是desk.xker.com和tool.xker.com,需把这两个域名都绑定到IP是219.13.34.32的服务器上1.首先需在域名供应商管理页面指定域名和IP的对应关系2.WEB服务器配置好LAMP环境3.把对应的源码分别放到/usr/local/apache/htdocs目录下,分别命名为upload和upload24.配置apache
2014-12-18 14:55:59
1991
原创 PHP求字符串的长度 部分正则表达式
function strLength($string){ $array = preg_split('/(?<!^)(?!$)/u',$string); return count($array); }
2014-11-26 14:22:05
1551
原创 PHP检查是否为移动设备
<?php$useragent=$_SERVER['HTTP_USER_AGENT'];if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|mid
2014-11-07 17:38:07
613
原创 mysql case when嵌套使用
SELECT id, type, content, uid2, time, readflag, CASE WHEN uid2 > 0 THEN readflag WHEN uid2 = 0 THEN CASE WHEN ( SELECT COUNT(*) FROM `tbl_SytemMsgRead` WHERE tbl_SytemMsgRead.`uid` = 5193 AND tbl_Sy
2014-11-07 14:46:10
13267
1
转载 nginx图片、css、js缓存
#图片缓存时间设置location ~ .*.(gif|jpg|jpeg|png|bmp|swf)${expires 8d;}#JS和CSS缓存时间设置location ~ .*.(js|css)?${expires 2h;}
2014-11-06 17:06:13
785
原创 PHP字符串截取,无乱码
function cutString($string,$length=10,$ellipsis='...'){ $array = preg_split('/(?<!^)(?!$)/u',$string); $return = ''; if( count($array) > $length ){ foreach($array as $key=>$val){ if( $le
2014-11-06 14:07:15
552
原创 PHP vsprintf() 函数
vsprintf() 函数把格式化字符串写入变量中。与 sprintf() 不同,vsprintf() 中的 arg 参数位于数组中。数组的元素会被插入主字符串的百分比 (%) 符号处。该函数是逐步执行的。在第一个 % 符号中,插入 arg1,在第二个 % 符号处,插入 arg2,依此类推。
2014-11-06 10:46:40
1251
原创 PHP 变量与类型相关扩展
PHP 变量与类型相关扩展http://php.net/manual/zh/refs.basic.vartype.php
2014-11-06 09:58:29
474
原创 ReflectionClass 类
ReflectionClass 类http://php.net/manual/zh/class.reflectionclass.php
2014-09-19 16:04:32
529
原创 PHP采集库-Snoopy.class.php
<?php$url = "http://www.example.com"; include("snoopy.php"); $snoopy = new Snoopy; $snoopy->fetch($url); //获取所有内容 echo $snoopy->results; //显示结果 //可选以下 $snoopy->fetchtext //获取文本内容(去掉html代
2014-08-10 00:10:37
799
原创 js动态加载
function loadJs(jsfile){ var htmltag = document.createElement('script'); htmltag.setAttribute("type","text/javascript"); htmltag.setAttribute("src",jsfile); if(typeof htmltag != "undefined")
2014-08-04 22:27:39
417
原创 PHP 设置session的生命周期
我们来手动设置 Session 的生存期: <?php session_start(); // 保存一天 $lifeTime = 24 * 3600; setcookie(session_name(), session_id(), time() + $lifeTime, "/"); ?>
2014-07-31 23:54:21
2345
原创 ie8下面处理 new Date()的问题
function getDays(strDateStart,strDateEnd){ var strSeparator = "-"; var oDate1; var oDate2; var iDays; oDate1= strDateStart.split(strSeparator); oDate2= strDateEnd.split(strSeparator); var strDat
2014-07-30 23:33:30
1216
原创 微信公众平台PHP开发,学习资料
1.微信帮助文档2.http://mp.weixin.qq.com/wiki/index.php?title=%E9%A6%96%E9%A1%B53.使用API大全http://www.1990c.com/?p=9944.微信外部资料http://www.1990c.com/?p=9325.资料文档和解释说明 ***https://github.com/netput
2014-07-12 23:23:28
1067
1
原创 开启Mysql慢查询
long_query_time = 1;log-show-queries = 'mysql_slow.log';log-queries-not-using=indexesmysqlreport 软件行锁定 InnodB 表锁定 Myisaminnodb_buffer_pool_size mysqlreport 重要软件i
2014-07-12 23:18:43
439
原创 codeigniter验证码操作
控制器application/controllers/welcome.php<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');class Welcome extends CI_Controller { /**a * Index Page for this controller.
2014-07-12 23:17:31
1251
原创 javascript分页处理
无标题文档var nowPage = page;var PagesLen = total;var PageNum=5;var PageNum_2=PageNum%2==0?Math.ceil(PageNum/2)+1:Math.ceil(PageNum/2);var PageNum_3=PageNum%2==0?Math.ceil(PageNum/2):Ma
2014-07-06 12:23:48
688
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人