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 Trong Php
-
Hàm Eval () Trong PHP - Plugin Thanh Toán
-
Hỏi Về Chức Năng Và Cấu Trúc Của Hàm Eval()
-
Eval () PHP Xây Dựng - EFERRIT.COM
-
Eval - Manual - PHP
-
Metaprogramming In PHP - Viblo
-
Giới Thiệu Hàm Eval Trong Javascript
-
Hàm Eval () Của PHP Có Dễ Bị Tấn Công Mã Khi Thực Thi Một Chuỗi ...
-
[Rootme] PHP – Eval - Nhienit
-
Hiểu Về Cấu Trúc Ngôn Ngữ PHP Của Eval () - Tháng Sáu, 2022
-
Hàm Eval Trong JavaScript
-
Ví Dụ Và Công Dụng Của Hàm Eval Trong Python - T3H
-
Php — Tính Biểu Thức Toán Học Từ Một Chuỗi Bằng Eval
-
Eval() Và Include()