PHP bug??global发现的问题
如下php代码
<?php
$type='a';
$target='type';
$a=array(1,2,3);
a($target);
function a($type)
{
global $$type;
var_dump($$type);
}
?>
预计输出的是string(1)”a”
可是结果是
Notice: Undefined variable: a in D:\web\global.php on line 11
NULL
因为global的时候引进了$type,顺便把全局的$type引进了,函数内部的$type的值被修改成了全局的'a',而函数内部又没有$a,所以报错和打印null
不知道这是php的错误还是就是global的机制,不过个人认为这个情况下只引进$type就可以了
相关文档:
<?php
include_once('include/pclzip.lib.php');
$archive = new PclZip('archive.zip');
//解压缩到extract/folder/这个目录中
$list = $archive->extract(PCLZIP_OPT_PATH, "extract/folder/");
//增加这个目录在压缩档中,完成以后压缩档里面会有backup这个目录,backup里面会有这两个档案 ......
几天没有更新的blog这两天在写个小东西玩玩
现在是基本能用了
最近没什么事做,就想到了查看服务端目录的小程序玩玩
现在查看已经写完了发上来给大家看看
demo地址
http://www.web-jia.com/demo/folder/demo.html
我分享的代码欢迎大家来下载啊
下载可以到
http://www.web-jia.com/viewthread.php?tid=2832&ext ......
<?php
/**
+++++++++++++++++++++=+++++上传图片++++++++++++++++++++++++++++++++++++++++
—————————————————————————————&mdas ......
1 文件结构
|
|――images
|――include
|――parameter
|――config
|――function
|――index
images存放图片文件,include中是系统是要引用的文件,一般在parameter中存放参数文件,config中存放配置文件,function中存放方法文件,如javascript的方法等,并按功能模块的分类,将各功能的类也放入其 ......
搞了很久。。终于发现原来是权限问题。。
2行命令搞定
grant all privileges on rogue.* to admin@localhost identified by 'admin' with grant option
grant all privileges on rogue.* to admin@'%' identified by 'admin' with grant option
经典了。。。
魔力私服网页端搞定咯~~ ......