PHP Eval() Function - W3Schools
Có thể bạn quan tâm
PHP eval() Function
❮ PHP Misc Reference ★ +1 Sign in to track progress
❮ PHP Misc Reference
Example
Evaluate a string as PHP code:
<?php$string = "beautiful"; $time = "winter"; $str = 'This is a $string $time morning!'; echo $str. "<br>"; eval("\$str = \"$str\";"); echo $str; ?>The output of the code above will be:
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 semicolon.
Note: A return statement will terminate the evaluation of the string immediately.
Tip: This function can be useful for storing PHP code in a database.
Syntax
eval(phpcode)Parameter Values
| Parameter | Description |
|---|---|
| phpcode | Required. Specifies the PHP code to be evaluated |
Technical Details
| Return Value: | Returns NULL unless a return statement is called in the code string. Then the value passed to return is returned. If there is a parse error in the code string, eval() returns FALSE. |
|---|---|
| PHP Version: | 4+ |
Từ khóa » Hàm Eval Php
-
Hàm Eval () Trong PHP - Plugin Thanh Toán
-
Eval - Manual - PHP
-
Eval () PHP Xây Dựng - EFERRIT.COM
-
Hỏi Về Chức Năng Và Cấu Trúc Của Hàm Eval()
-
PHP | Eval() Function - GeeksforGeeks
-
Metaprogramming In PHP - Viblo
-
Evaluate A String As PHP Code
-
Hàm Eval () Của PHP Có Dễ Bị Tấn Công Mã Khi Thực Thi Một Chuỗi ...
-
Understanding The Eval () PHP Language Construct - ThoughtCo
-
[Rootme] PHP – Eval - Nhienit
-
Hiểu Về Cấu Trúc Ngôn Ngữ PHP Của Eval () - Tháng Sáu, 2022
-
How To Use Eval Function In Php? - Lotus
-
PHP Eval() Function - RoseIndia.Net