【发布时间】:2012-10-01 20:05:49
【问题描述】:
$this->Settings = array( "host" => $host , "user" => $user , "pass" => $pass );
$this->db = $db;
$this->Settings["name"] = ereg_replace ("_", "", $this->db);
$this->init();
我有一个应用程序在从 php 5.2 迁移到 php 5.3 后无法运行。
即使我将上面的 ereg_replace 行更改为
$this->aSettings["name"] = preg_replace("/_/", "", $this->db);
它仍然没有从数据库中获取设置。
【问题讨论】:
-
如果问题是没有从数据库中检索到值,那么问题出在您的
$db变量中。尝试检查它的值:var_dump($db)
标签: php preg-replace ereg-replace