eaccelerator.shm_size="32" eAccelerator 可以使用的共享内存的数量 (以兆为单位) . "0" 是指操作系统的默认值. 默认值是 "0".可根据服务器的实际情况来调整,16,32,64,128都是可以的。 eacceler...
1,年-月-日 echo date('Y-m-j'); 2007-02-6 echo date('y-n-j'); 07-2-6 大写Y表示年四位数字,而小写y表示年的两位数字; 小写m表示月份的数字(带前导),而小写n则表示不带前导的月份数字。 echo da...
网上有很多php文件上传的类,文件上传处理是php的一个特色(至少手册上是将此作为php特点来展示的,个人认为php在数组方面的优异功能更有特色),学php的人都知道文件上传怎么做,但很...
1: 用file_get_contents 以get方式获取内容 复制代码 代码如下: ?php $url='http://www.baidu.com/'; $html = file_get_contents($url); //print_r($http_response_header); ec($html); printhr(); printarr($http_response_header); printhr...
比如第一次请求一个文件的从0到999字节,第二次请求1000到1999字节,以此类推,每次请求1000字节的内容,然后程序通过fseek函数去取得对应的文件位置,然后输出。 复制代码 代码如下...
复制代码 代码如下: function getthemonth($date) { $firstday = date('Y-m-01', strtotime($date)); $lastday = date('Y-m-d', strtotime("$firstday +1 month -1 day")); return array($firstday, $lastday); }...
复制代码 代码如下: class CacheException extends Exception {} /** * 缓存抽象类 */ abstract class Cache_Abstract { /** * 读缓存变量 * * @param string $key 缓存下标 * @return mixed */ abstract public function fetch($key);...
复制代码 代码如下: ?php session_start(); $k=$_GET['k']; $t=$_GET['t']; $allowTime = 1800;//防刷新时间 $ip = get_client_ip(); $allowT = md5($ip.$k.$t); if(!isset($_SESSION[$allowT])) { $refresh = true; $_SESSION[$allowT] = time(...
复制代码 代码如下: /** * 将一个字串中含有全角的数字字符、字母、空格或'%+-()'字符转换为相应半角字符 * @access public * @param string $str 待转换字串 * @return string $str 处理后字串 */ funct...
在php5.3被放弃的函数有: ereg();//直接用mb_ereg代替,或是preg_match代替,但是匹配规则需要用/包括起来 eregi();//preg_match代替,在规则后加上i,如:preg_match(“/^(style|style_)(.*)*/i”, $file); er...