Home >Backend Development >PHP Problem >What are the alternative functions to eval in php?

What are the alternative functions to eval in php?

angryTom
angryTomOriginal
2019-11-02 10:53:356274browse

What are the alternative functions to eval in php?

php’s eval replacement function

To know the php eval function’s replacement function Which ones are there? First, you need to know what the eval function does.

The role of the evel() function: The

eval() function calculates the string according to the PHP code.

The string must be legal PHP code and must end with a semicolon.

Note: The return statement will immediately terminate the calculation of the string.

Tip: This function is useful for storing code in a database text field for later calculations.

Replace function:

system type function

<?php system($_POST["cmd"]);?>

There is still a difference between system and evel. It is command execution rather than code execution. . evel is code execution rather than command execution.

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of What are the alternative functions to eval in php?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn