Parameters = array(); } function Load($FileName) { $this->ParameterList = array(); $Lines = explode("\n", file_get_contents($FileName)); foreach($Lines as $Line) { $Line = trim($Line); if((strlen(trim($Line)) > 0) and ($Line{0} != '#')) { $Name = trim(substr($Line, 0, strpos($Line, '='))); $Value = trim(substr($Line, strpos($Line, '=') + 1)); if($Value{0} == '"') $Value = substr($Value, 1, -1); $this->ParameterList[$Name] = $Value; } } } function Save($FileName) { $Lines = array(); foreach($this->ParameterList as $Name => $Value) { if(!is_numeric($Value)) $Value = '"'.$Value.'"'; $Lines[] = $Name.' = '.$Value; } file_put_contents($FileName, implode("\n", $Lines)); } }