auto_append_file=”…/footer.inc”.ht
access文件配置单个目录的选项可以配置目录的下的页面的页眉和页脚灵活但性能下降php_valueauto_preend_file”…/header.inc”php_valueauto_append_file=”…/footer.inc”变量名区分大小写但函数名称不区分大小写(一般都使用小写)global$var;声明具有全局作用域的变量函数的参数前加&;实现引用传递类的基本结构classpoint{var$x,$y;function__constructor($a,$b){}functiongetx(){return$this->x;function__destruct(){}$p1=newpoint(10,20);echo$p1->x;}
}
$v1->attribute=100;public(默认)privatepretectedextends继承函数定义时函数名前加final表示禁止继承parent::operation();interfacedisp{functiondisplay();}//定义接口实现接口class
webpimplementsdisp{functiondisplay(){//实现}
class前也可以加final禁止继承类
}一个类只可以继承一个类,但是可以同时实现一个或者多个接口。
Htmlspecilchars()对字符串中的特殊意义字符进行编码SHA1()计算散列值
Header(‘Location:http://..........’);可以实现重定向存储和使用SessionID(1)php.ini中设置session.use_trans_sid(2)
”>链接(3)编译时选中—enable_trans_sid选项
Isset()检查变量是否存在
魔术引用(1)Php.ini中设置magaic_quotes_gpcget_magaic_quotes_gpc()set_magaic_quotes_gpc()magic_quotes_runtimeget_magic_quotes_runtime(),set_magic_quotes_runtime()(2)addslashesstropslashes函数eval函数执行字符串中的php代码中断执行(1)exit();(2)exit(“错误”);(3)die(error_handle());error_handle()为错误处理函数变量和对象的序列化$so=serialize($obj);序列化$new_so=unserialize($so);还原序列化对象
获取加载的PHP扩展部件$extensions=get_loaded_extensions();$ext_funcs=get_extension_funcs($extensions[$i]);返回该部件中所有的可用函数。get_current_user();获取当前脚本的所有者getlastmod();获取脚本的最后修改时间。动态加载PHP扩展部件在运行时dl(‘php_gd2.dll’);dl(‘php_gd2.so’);静态加载PHP扩展部件php.ini中设定extension_dir目录会自动加载