PHP Eval() Function - RoseIndia.Net
Có thể bạn quan tâm
Learn how to use Eval () PHP Function to execute PHP code.
Learn how to use Eval () PHP Function to execute PHP code. PHP eval() FunctionIn this tutorial we will learn about the PHP eval() function. The php eval() function can be used if you want to store the php command in MySQL table or in text file and then run the same in a PHP script.
The PHP eval() function:
The PHP eval() function evaluates the passed string parameter as PHP code. The string parameter must be a valid PHP code and end with a semicolon, just like regular PHP code.
After the evaluation of the string it returns NULL value if there is no return statement in the string. If there is some parse error in the string the eval() function returns FALSE.
Syntax of eval() function:
eval(codeasstring)
| Parameter | Description |
| codeasstring | The parameter is required and it must be valid PHP code. |
Example code of eval() function:
The following example how to use eval() function.
<?php $string = "Hello"; $today = date("F j, Y, g:i a"); $str = 'Say $string to PHP. Today is $today'; echo $str. "<br />"; eval("\$str = \"$str\";"); echo $str; ?>
The out put of the program is:
Say $string to PHP. Today is $today Say Hello to PHP. Today is August 31, 2010, 4:40 am
Từ khóa » Hàm Eval Php
-
Hàm Eval () Trong PHP - Plugin Thanh Toán
-
Eval - Manual - PHP
-
PHP Eval() Function - W3Schools
-
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