how can create notepad file in php

<?php
//how can create notepad file in php
$t= fopen("testfiles.txt", "w") or die("Unable to open file!");
$txt = "John Doe\n";
fwrite($t, $txt);
$txt = "Jane Doe\n";
fwrite($t, $txt);
fclose($t);

?>