파일의 내용을 다른 파일로 출력하고 있지만 내용이 두 번째 파일에 들어 있지 않습니다. 파일을 생성하지만 출력을 파일에 저장하지 않으면 출력을 화면에 표시합니다.file_put_contents를 사용하여 파일에 내용을 추가 할 수 없습니다.
require_once 'templates/'.$layout.'/contact.php';
ob_start();
$content = ob_get_clean();
file_put_contents($dir.'/contact.php',$content);
chmod($dir.'/contact.php',0777);
재미있는 것은 내가이 file_put_contents를을 ($ dir을 '/ contact.php', 'DSF를'.)이다; file_put_contents ($ dir. '/ contact.php', $ content)를 수행 할 때 파일에 씁니다. is not? 당신이 이해하지 않는 파일
@Roland - 정답으로 표시해야합니다. – karim79
@Roland - 감사, @Antonio - 표결. – karim79
고쳐, 안토니오 – Roland