PHP eval () function operation array:
<?php
$data = "Array (' Key1 ' => ' value1 ', ' key2 ' => ' value2 ', ' Key3 ' => ' value3 ', ' key4 ' => ' value4 ')";
$arr = eval ("Return $data;");
Var_dump ($arr); Array
?>
Run Result:
Array (4) {["Key1"]=> string (6) "value1" ["Key2"]=> string (6) "value2" ["Key3"]=> string (6) "Value3" ["Key4"]=&G T String (6) "Value4"}
Many people on the internet say that using disable_functions to prohibit eval is wrong!
In fact, eval () cannot be banned by the disable_functions in php.ini:
Because Eval () is a language construct and not a function
Eval is Zend, so it is not a php_function function;
So how does PHP prohibit eval?
If you want to ban eval, you can use PHP's extended suhosin:
After installing the Suhosin in the php.ini load comes in suhosin.so, plus suhosin.executor.disable_eval = on can
Thank you for reading, I hope to help you, thank you for your support for this site!