I have seen but not played with a set of INI file control functions...
http://pear.php.net/package/Config
however you could simply read in the file into the array with
[man]parse_ini_file/man and then write a loop which would write a string of that array in INI format... just skipping over the section you would like to delete... something as simple as this might do <i left out any sanity checks on $val that you should have>
$filename = 'foo.ini';
$parsed_ini = parse_ini_file($filename,true);
$skip = 'section2';
$output = '';
foreach ( $parsed_ini as $section=>$info ) {
if ( $section != $skip ) {
$output += "[$section]\n";
foreach ( $info as $var=>$val ) {
$output += "$var=$val\n";
}
$output += "\n\n";
}
}
$file_resource = fopen($filename, 'w');
fwrite($file_resource, $output);
fclose($file_resource);