파일을 읽은 다음이 파일을 한 행씩 살펴 봅니다.파일의 값 바꾸기 및 저장
$filePath = $_REQUEST['fn'];
$lines = file();
foreach ($lines as $line_num => $line)
{
if(stristr($line,'Device') && stristr($line,'A=0FEDFA')) $line = str_replace ("ID=\"", "ID=\"***",$line);
if(stristr($line,'Style')) $line = str_replace ("ID=\"", "ID=\"***",$line);
}
(가) 어떻게 $적인 filePath로이 다시 저장합니까 : 값이 업데이트되는 라인에 일치하는 경우
?
f 문자열을 쓰기 위해 fwrite() 사용 이 링크를 사용해보십시오. http://stackoverflow.com/questions/235604/overwrite-line-in-file-with-php –