YouTip LogoYouTip

Func Misc Eval

# PHP eval() Function [![Image 3: PHP Misc Reference Manual](#) PHP Misc Reference Manual](#) ## Example Treat a string as PHP code to evaluate: ```php The output of the above code execution is: This is a $string $time morning! This is a beautiful winter morning! * * * ## Definition and Usage The eval() function evaluates a string as PHP code. The string must be valid PHP code and must end with a semicolon. **Note:** The return statement immediately terminates the evaluation of the string. **Tip:** This function is useful for storing code in database text fields for later evaluation. * * * ## Syntax eval(phpcode) | Parameter | Description | | --- | --- | | _phpcode_ | Required. Specifies the PHP code to be evaluated. | ## Technical Details | Return Value: | Returns the value passed to the return statement if called within the code string, otherwise returns NULL. Returns FALSE if there is a parse error in the code string. | | :--- | | PHP Version: | 4+ | * * PHP Misc Reference Manual](#)
← Func Misc ExitFunc Misc Die β†’