I'm outputting the contents of a file to another file, but the contents is just not being put into the second file. It creates the file but does not put the output to the file, it displays the output on the screen.
require_once 'templates/'.$layout.'/contact.php';
ob_start();
$content = ob_get_clean();
file_put_contents($dir.'/contact.php',$content);
chmod($dir.'/contact.php',0777);
The funny thing is when I do this file_put_contents($dir.'/contact.php','dsf'); it writes to the file, when doing file_put_contents($dir.'/contact.php',$content); is does not?