September 2001
Intermediate to advanced
768 pages
32h 45m
English
mixed eval(string php_code) Evaluates a string as PHP code.
Returns:
Return value of the evaluated code (often this is NULL)
Description:
eval() is used to evaluate a string as PHP code. It’s most often used to execute PHP code that’s built at runtime or to get around some of the limitations in the PHP parser. Use of eval() can be somewhat tricky at times. Novice programmers have suggested that evil() would be a more appropriate name for the function.
eval() behaves as if the string being evaluated was a normal block of code in the same scope as the call to eval(). The best way to explain this is by using a few simple code examples. In PHP 4, there is an exception to this rule. A return statement can be used to stop parsing of the evaluated ...
Read now
Unlock full access