First Draft
First Draft of the Example Files
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
$fh = fopen("testfile.txt", 'r+') or die("Failed to open file");
|
||||
$text = fgets($fh);
|
||||
|
||||
if (flock($fh, LOCK_EX))
|
||||
{
|
||||
fseek($fh, 0, SEEK_END);
|
||||
fwrite($fh, "$text") or die("Could not write to file");
|
||||
flock($fh, LOCK_UN);
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
echo "File 'testfile.txt' successfully updated";
|
||||
?>
|
||||
Reference in New Issue
Block a user