//파일 경로 & 파일 이름 $refPath = "파일경로"."/파일이름"; //$refPath 경로에 쓰기 전용으로 파일을 만듦 $csvfile = fopen($refPath, "w") or die("Unable to open file"); //파일 UTF-8로 저장하기 fwrite($csvfile, pack("CCC",0xef,0xbb,0xbf)); //파일에 내용 쓰기 fwrite($csvfile, "TEST"); fwrite($csvfile, "파일에 적을 내용"); //파일 닫기 fclose($csvfile);