All pastes #588000 Raw Edit

Mine

public text v1 · immutable
#588000 ·published 2007-06-25 09:07 UTC
rendered paste body
the object 

class datavariables {
  var $alowedDB, $mettaTables;
  //create the data objects
  function datavariables() {
    $this->alowedDB = array();
    foreach(file('scripts/configs/databases.txt') as $line)
      array_push($this->alowedDB,$line);
  }
  //test if its part of that array
  function testAlowedDB($testCase){
    return array_search($testCase,$this->alowedDB);
  }
//for something else
  function getAlowedDBs(){ return $this->alowedDB; }
}

the calling code 
dbSelector($_GET['DB']);

function dbSelector($db){
  $variables = new datavariables();
  $dbb = array_pop($variables->getAlowedDBs());
  echo $dbb.' - '.$db.'<br>';
  echo  var_dump($variables->testAlowedDB($dbb)).' - '.var_dump($variables->testAlowedDB($db));

the results 

media - media
int(1) bool(false) -