Does someone know how can I find a line in a ini file and erase using php?
fopen etc..?
Use this :
$content = '';
// iterate over each line of the ini file
foreach(file('your.ini') as $line) {
// if the line doesn't start with YOURKEY ...
if(!preg_match('~^YOURKEY~', $str)) {
// add it to output
$content .= $line;
}
}
file_put_contents('your.ini', $content);