파일을 열고 일부 콘텐츠 (12345를 77348)로 대체하고 저장해야합니다. 멀리까지 나는 php fopen, str_replace
그러나 그것은 작동하지 않는 것 .... 나는 어떤 도움을 주셔서 감사합니다!$cookie_file_path=$path."/cookies/shipping-cookie".$unique; $handle = fopen($cookie_file_path, "r+"); $cookie_file_path = str_replace("12345", "77348", $cookie_file_path);
fclose($handle);
미안 상세한 답을 게시 할 시간이 없어,하지만 당신은 $의 cookie_file_path 아닌 파일의 실제 내용에 "77348"과 "12345"를 대체 할 않는 str_replace를 말하는 것입니다. 파일 내용을 버퍼로 읽고 THAT에서 바꾸고 파일 내용을 다시 써야합니다. – jaywon
어딘가에도 fwrite를 원할 것입니다. – JAL