1
$this->Settings = array( "host" => $host , "user" => $user , "pass" => $pass );
    $this->db = $db;
    $this->Settings["name"] = ereg_replace  ("_", "", $this->db);
    $this->init();

I have an application that can't work after migrating to php 5.3 from php 5.2.

Even after i changed the ereg_replace line above to

$this->aSettings["name"] = preg_replace("/_/", "", $this->db);

It still doesn't get the settings from the db.

Ja͢ck
  • 170,779
  • 38
  • 263
  • 309
Potential Coder
  • 91
  • 3
  • 11
  • If the problem is that the value is not retrieved from the database then the problem is in your `$db` variable. Try to inspect its value: `var_dump($db)` – pankar Oct 11 '12 at 08:02

1 Answers1

3

There's no particular reason why your preg_replace() wouldn't work, but you could simply use str_replace() instead.

$this->Settings['Name'] = str_replace('_', '', $this->db);

This statement interests me though:

$this->db = $db;

Where is $db set? Follow that trail until you find where the real issue is,

Ja͢ck
  • 170,779
  • 38
  • 263
  • 309