config = array(); // initialize array // parse config file $fh = fopen($propertiesFile, 'r+'); while (!feof($fh)) { $line = fgets($fh); $eqpos = strpos($line, '='); $parameterName = substr($line, 0, $eqpos); $parameterValue = substr($line, ($eqpos + 1)); // assign parameter values to the config array $this->config[$parameterName] = $parameterValue; } } public function get(string $param) { return $this->config[$param]; } }