<?php $handle = fopen("log.txt", "w"); if ($handle) { fwrite($handle, "Line one\n"); fwrite($handle, "Line two\n"); fclose($handle); echo "File written successfully."; } ?>
Click Run to execute this code.