02 2013 档案
摘要:memcache是一种缓存技术,主要把数据放在内存中管理访问,从而提高访问速度。一般查询从几个方面获取数据:数据库交互、硬盘中文件缓存、内存中数据缓存,从内存中访问最快!mamcache把数据以表(hahstable)的形式放在内存中,结构是 key(字符串) value(字符串,数值,数组,对象,
阅读全文
摘要:php中静态公开方法static public可以在类外 类名::方法 调用 当没有static的public方法时,在某种条件下也可以采用此方式调用,虽然会报Strict Standards错误 这种条件是调用的这个方法中不能使用代表对象本身的$this View Code 1 <?php 2 /
阅读全文
摘要:数据写入数据库时,需对数据进行转义,以便数据安全写入数据库 常用有: mysqli::real_escape_string View Code mysqli_real_escape_string View Code mysql_real_escape_string View Code 1 <?php
阅读全文
摘要:magic_quotes_gpc的设定值将会影响通过Get/Post/Cookies获得的数据magic_quotes_runtime的设定值将会影响从文件中读取的数据或从数据库查询得到的数据 两者的影响都是做转义 同addslashes()函数功能 可以用get_magic_quotes_gpc(
阅读全文
摘要:View Code 1 <meta content="text/html" charset="utf-8"/> 2 <?php 3 $a=array ( 4 0 => 5 array ( 6 'id' => '134', 7 'fid' => '0', 8 'name' => 't', 9 ), 1
阅读全文
摘要:压缩类zipclass.php View Code 1 <?php 2 # 3 # PHPZip v1.2 by Sext () 2002-11-18 4 # (Changed: 2003-03-01) 5 # 6 # Makes zip archive 7 # 8 # Based on "Zip
阅读全文
摘要:[PHP] ;;;;;;;;;;;;;;;;;;; ; About php.ini ; ; 关于 php.ini ;;;;;;;;;;;;;;;;;;; ; PHP's initialization file, generally called php.ini, is responsible for
阅读全文
摘要:使用的php版本都是线程安全可用,线程不安全不可用
阅读全文
摘要:出现1366报错,是中文字符串识别错误 设置当前连接的字符集即可 set character set 'GBK'; 一般mysql中默认字符集包含: 创建数据库时的字符集 可设定否则为默认 my.ini设置 选定数据库时的字符集 可设定 创建表时的字符集 可设定 设置字段时的字符集 可设定 一般需保
阅读全文
摘要:设置 View Code <?php require './libs/Smarty.class.php'; $smarty = new Smarty; $smarty->template_dir = './templates';//模板目录 $smarty->compile_dir = './tem
阅读全文
摘要:MyMiniSmarty.class.php View Code 1 <?php 2 /** 3 * 模板类 4 * 1、读取模板文件 5 * 2、把模板文件替换成可以运行的php文件 6 * 3、包含缓存机制--文件 7 */ 8 9 class MyMiniSmarty { 10 //var 为
阅读全文
摘要:环境:php5.3 apache2.2 下载http://pear.php.net/go-pear.phar go-pear.phar,放入php目录 此目录运行命令行 php.exe go-pear.phar 依次设置完成安装
阅读全文

浙公网安备 33010602011771号