Write a PHP script that reads data from one file and write into another file ?

Program:-

<?php

$myfile = fopen("abc.txt", "w") or die("Unable to open file!");

$txt = "Welcome to VAAGESWARI\n";

fwrite($myfile, $txt);

fclose($myfile);

$myfile = fopen("abc.txt", "r") or die("Unable to open file!");

echo fgets($myfile);

fclose($myfile);

?>

Output:-