摘要:http://www.cnblogs.com/bluefrog/archive/2012/03/01/2374922.html
阅读全文
摘要:以下是一段PHP+Memcache的缓存+读取过程,一看,有点类似于PHP的SESSION保存方法,使用起来也非常简单。帮助0102030405060708091011121314151617181920212223242526272829303132333435363738connect("127...
阅读全文
摘要:http://pjdong1990.iteye.com/blog/1610305
阅读全文
摘要:1、由于CentOS系统默认源没有memcache安装包,因此需要导入第三方的源。执行如下两条命令:[root@EACNCTCSHHSHH00B001 data]# wget ftp://fr2.rpmfind.net/linux/epel/5/ppc/epel-release-5-4.noarch...
阅读全文
摘要:<?phpnamespace LIB;include 'test.php';//引入带命名空间的文件include '__init__.php';//引入公共函数class MySQL {}class SQLite {}function show(){ return "111";}namespace LIB_EXTRA;use LIB as T;//声明使用 空间LIBclass MScrypt {}$a = new MScrypt();function show(){ return "ad";}use foo as
阅读全文
摘要:ob_end_clean(); set_time_limit(0); ob_start(); $filename = basename($path); $suffix = self::extension($filename); header('Content-Type:'类型' ); header('Content-Disposition: attachment; filename=' . $filename); //读取超大文件 $h...
阅读全文
摘要:Mysql导出表结构及表数据 mysqldump用法 命令行下具体用法如下: mysqldump -u用戶名 -p密码 -d 數據库名 表名 脚本名; 1、导出數據库為dbname的表结构(其中用戶名為root,密码為dbpasswd,生成的脚本名為db.sql) mysqldump -uroot -pdbpasswd -d dbname >db.sql; 2、导出數據库為dbname某张表(test)结构 mysqldump -uroot -pdbpasswd -d dbname test>db.sql; 3、导出數據库為dbname所有表结构及表數據(不加-d) mysqldu
阅读全文
摘要:PHP实现通过经纬度计算距离单位为公里function getdistance($lng1,$lat1,$lng2,$lat2)//根据经纬度计算距离{//将角度转为狐度$radLat1=deg2rad($lat1);$radLat2=deg2rad($lat2);$radLng1=deg2rad($lng1);$radLng2=deg2rad($lng2);$a=$radLat1-$radLat2;//两纬度之差,纬度<90$b=$radLng1-$radLng2;//两经度之差纬度<180$s=2*asin(sqrt(pow(sin($a/2),2)+cos($radLat1)
阅读全文
摘要:Compiling shared PECL extensions with phpizeSometimes, using the pecl installer is not an option. This could be because you're behind a firewall, or it could be because the extension you want to install is not available as a PECL compatible package, such as unreleased extensions from SVN. If you
阅读全文
摘要:环境:centos 6.4 +lamp(yum安装)获取memcache扩展wget http://pecl.php.net/get/memcache-2.2.5.tgz解压:gzip -d memcache-2.2.5.tgztar xvf memcache-2.2.5.tarcd memcache-2.2.5运行phpize:phpizeConfiguring for:PHP Api Version:20041225 Zend Module Api No:20060613Zend Extension Api No:220060519./configure --enable-memcache
阅读全文
摘要:soap ( Simple Object Access Protocol)简单对象访问协议php有两个扩展可以实现web service,一个是NuSoap,一个是php 官方的soap扩展,由于soap是官方的,所以我们这里以soap来实现web service.由于默认是没有打开soap扩展的,所以自己先看一下soap扩展有没有打开。在soap编写web service的过程中主要用到了SoapClient,SoapServer,SoapFault三个类。SoapClient类这个类用来使用Web services。SoapClient类可以作为给定Web services的客户端。它有两
阅读全文
摘要:http://www.cnblogs.com/baochuan/archive/2012/03/12/2391135.html#fanxiangyinyong元字符 正则具有特殊意义的专用字符 \w 匹配 字母数字下划线汉字 \s 空白符 \d 数字 - 表示范围 [] 匹配括号中任意个字符 ^: > 放在字符域(如:[^\w])中表示否定(不包括的意思)——“反向选择” > 放在表达式之前,表示以当前这个字符开始。(/^n/i,表示以n开头)。分组:零宽度断言:(?=exp) 匹配exp前面的位置 (? 指明类型指的是通配符。所以只有圆括号起始位置没有问号的才能被捕捉。>
阅读全文
摘要:http://www.cnblogs.com/jhti/archive/2011/12/27/2304128.htmlhttpd-vhosts虚拟主机设置(单IP多域名)1、打开ahache目录下的httpd.conf文件;(如图)或在此路径下查找:E:\wamp\bin\apache\Apache2.2.17\conf查找到如下模块:#Include conf/extra/httpd-vhosts.conf去掉前面的#,这样就开启了httpd-vhosts虚拟主机模块;2、在你平时习惯使或可以快速访问到的盘上新建文件夹命名为:apache_conf(文件名随便,容易辩认即可。)用于存放虚拟主
阅读全文
摘要:在此论坛上有很多关于session的问题.我现在将自己的一些理解和曾经碰到的问题总结一下,希望对session 有困惑的朋友跟贴,一起探讨,尽量将困惑降到最低.简单介绍:------------------------------------------------------------------------------session的内容是存储的在服务器上,安全性能比较好,不容易被盗看,但是如果 session的量太大的时候,会占太多的服务器空间。cookie是存储在客户端上的,不会耗费服务器资源,但是安全性会差一点,而且使用 cookie会依赖于客户端的设置。cookie不会依赖于se
阅读全文
摘要:$arr= array( 'lastname' => iconv('gb2312', 'utf-8', '勿扰'), 'contact' => array( 'email' =>'fcwr@dibaye.com', 'website' =>'http://www.dibaye.com', ) ); //将数组编码成JSON数据格式print_r($arr);$json_string = json_encode($arr); //
阅读全文
摘要:函数ini_set()设置时区:可以在文件开头加入 ini_set('date.timezone','Asia/Shanghai'); // 'Asia/Shanghai' 为上海时区手动修改php.ini设置打开php找到date.timezone = "PRC" 如有去掉前面的分号,没有的话手动添加!date_default_timezone_set("Asia/Shanghai");//中国时区date_default_timezone_set("Etc/GMT-8");//中国时
阅读全文
摘要:echo system('"c:\Program Files\winRAR\Rar.exe" a d:\111sd.rar c:/1.doc'); echo system('"e:\wamp\bin\mysql\mysql5.5.24\bin\mysqldump.exe" -uroot -p123456 test qibosoft_zone > d:\12.sql'); echo system('"e:\wamp\bin\mysql\mysql5.5.24\bin\mysql.exe" -
阅读全文