sam - 2010-10-20 09:11:07
function delete_key( $path, $keyNAME )
{
$fileCONTENTS = "" ;
$this->filePATH = $path ;
$INIarray = $this->parse_ini_file( $path );
if ( is_array( $INIarray ) )
{
foreach ($INIarray as $i => $a)
{
$c2 = 0 ;
if ( is_array( $a ) )
{
foreach ($a as $n => $value)
{
if (strcmp( $i, $keyNAME ) != 0 )
{
if ( $c2 == 0 ) $fileCONTENTS .= "[$i]$this->crlf$n=$value$this->crlf";
else if ( strlen( $value ) != 0 ) $fileCONTENTS .= "$n=$value$this->crlf";
$c2++;
}
}
$fileCONTENTS .= $this->crlf ;
}
}
}
$hFile = @fopen( $path, "w+" );
@fwrite( $hFile, $fileCONTENTS );
@fclose( $hFile );
}