Unable to write to file due to empty section or var (Section: $section -> Var: $var -> Value: $value)"); } $contents = $this->read($file); $contents[$section][$var] = $value; if ( empty ( $value ) ) { unset($contents[$section][$var]); } $output = ";\n; File created by Afterlife(69)'s INI Class\n; Copyright 2006, Dean Newman - Licenced under GNU/GPL v2\n;\n"; while ( list ( $key, $array ) = @each ( $contents ) ) { if ( is_array ( $contents[$key] ) ) { $output .= "[$key]\n"; } while ( list ( $var, $value ) = @each ( $array ) ) { $output .= "$var = $value\n"; } $output .= "\n"; } $handle = @fopen($file, 'w'); @fwrite($handle, $output); @fclose($handle); } } /************************************************************************ ** Software : ini_file.class.php ** Purpose : Reads ini files into an array, can also read single groups or vars ** Author : Dean Newman of Project07.com ** Licence : GNU/GPL v2 ************************************************************************/ ?>