> Hey everyone, > > I am reading an ini file into an array using the parse_ini_file() function. What I >want to do is delete a section from the ini file, and > thought that the best way to >do it would be to unset one of the keys in the array returned by the parse function. >I then want to > > write the modified array back out to the ini file. I am having a hard time doing >the unset though - what am I missing? > > ***** CODE ***** > // Parse out the events file > $array = parse_ini_file('./data/events', TRUE); > while($key = key($array)) > { > if ($key == $event) > { > unset($key); > next($array); > } > else { next($array); } > }
> // This prints the contents of the array, and the value that I tried to unset is >still there... > print_r($array); > > ***** END CODE ***** > > Thanks! > > -Erich- Never mind. I am SUCH a moron. // This works just fine... unset($array[$event]); -Erich-