Answers for "how to create a file in php and write some text in it"

PHP
2

write in a file using php

<?php
$myfile = fopen("file_name.txt", "w") or die("Unable to open file!");
$txt = "Hello world\n";
fwrite($myfile, $txt);
$txt = " Php.\n";
fwrite($myfile, $txt);
fclose($myfile);
?>
Posted by: Guest on June-05-2020

Code answers related to "how to create a file in php and write some text in it"

Browse Popular Code Answers by Language