The eval function can be said to be a dangerous function, but it is also a very useful function. In our PHP manual, you will see this and a sentence introduction about the eval function. The eval() function calculates the string according to the PHP code. It means it can execute php files.
eval(phpcode) required. Specifies the PHP code to be calculated.
Example 1
The code is as follows
|
Copy code
|
||||||||
$string = 'cup';
This cup contains coffee.
Have you found a problem? The characters $string in the $str variable can be directly entered into the value of the variable. This means that the php code can be executed. I just said that the eval function is dangerous. As simple as the following sentence, all data on your website can be modified at any time.
This function cannot be disabled in this way, because there is a sentence in the PHP manual "eval is a language constructor and not a function" http://www.bkjia.com/PHPjc/629635.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629635.htmlTechArticleThe eval function can be said to be a dangerous function, but it is also a very useful function. It will be discussed in our PHP manual See this and a sentence about the eval function. The eval() function converts the string according to... |