php eval() 函数操作数组:
word-spacing: 0px; -webkit-text-stroke-width: 0px; background: rgb(255, 255, 255);\">$data = "array('key1'=>'value1','key2'=>'value2','key3'=>'value3','key4'=>'value4')";word-spacing: 0px; -webkit-text-stroke-width: 0px; background: rgb(255, 255, 255);\">$arr = eval("return $data;");var_dump($arr); //array?>运行结果:
array(4) { ["key1"]=> string(6) "value1" ["key2"]=> string(6) "value2" ["key3"]=> string(6) "v网上很多说使用disable_functions禁止掉eval的方法都是错误的!
其实eval()是无法用php.ini中的disable_functions禁止掉的 :
because eval() is a language construct and not a function
eval是zend的,因此不是PHP_FUNCTION 函数;
那么php怎么禁止eval呢?
如果想禁掉eval可以用php的扩展 Suhosin:
安装Suhosin后在php.ini中load进来Suhosin.so,再加上suhosin.executor.disable_eval = on即可
【php禁用eval】php禁用eval() 函数实例 php怎么禁用eval() 函数
http://m.bbyears.com/jiaocheng/115398.html
推荐访问: