Hy Guys i tried to write with php an other php file but always fail... Is it possible to do it like my snippet? Thanks in advance.
$newfile = fopen("file.php", "w") or die("Unable to open file!");
$txt = "<html>
<title>my php file written with php</title>
<link href="css/style.css" rel="stylesheet">
include 'header.php'
<BR><BR><BR><BR>
This is the php file written by a php page.
Here is a link: <a HREF='index.html'>home</a>.
<script>
$(document).on('click', '.option-btn', function () {
$(this).toggleClass('open');
$('.control-center').toggleClass('open');
});
</script>
</body>
</html>";
fwrite($newfile, $txt);
fclose($newfile);
</div>