fwrite() function
<?php $filename = "example.txt"; $file = fopen($filename, "w") or die("Unable to open file!"); $text = "Hello, World!"; fwrite($file, $text); fclose($file); echo "Data written to $filename successfully."; ?>
fwrite() function
<?php $filename = "example.txt"; $file = fopen($filename, "w") or die("Unable to open file!"); $text = "Hello, World!"; fwrite($file, $text); fclose($file); echo "Data written to $filename successfully."; ?>