If you want to delete a file after working with it, use the unlink() function. This function only accepts one parameter, a filename of the file you want to be removed.
<?php unlink( "notes/data/names.txt" ); ?>
This function returns true if the file was successfully deleted and returns false if not. An error typically occurs only when you do not have permission to delete the file or when the given file was not found.