Php Create New Txt File

[Solved] Php Create New Txt File | Php - Code Explorer | yomemimo.com
Question : write in a file using php

Answered by : ankur-prajapati

<?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);
?>

Source : | Last Update : Fri, 12 Jun 20

Answers related to php create new txt file

Code Explorer Popular Question For Php