-3
A
답변
0
사용이 :
$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);
0
PHP는 쓰기 유사 읽을 수 있지만 뭔가에 좋은 곳입니다 parse_ini_file
있다. http://pear.php.net/package/Config_Lite을 살펴 보시겠습니까? 이렇게하면 작업이 간단 해집니다.
시도해 보셨습니까? –