输出:
This is a $string $time morning!
This is a beautiful winter morning!
eval() 函数在CodeIgniter框架里也有用到。在 /system/database/DB.php 文件中,根据系统的配置动态的定义了一个类 CI_DB,具体代码片段如下:
if ( ! isset($active_record) OR $active_record == TRUE)
{
require_once(BASEPATH.'database/DB_active_rec.php');
// Instantiate the DB adapter
$driver = 'CI_DB_'.$params['dbdriver'].'_driver';
$DB = new $driver($params);
以上这篇浅谈PHP eval()函数定义和用法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。