I am trying to read and write to / from the same file, is this possible?
Here is what I get the negative results:
<?php
$file = fopen("filename.csv", "r") or exit("Unable to open file!");
while (!feof($file)) {
$line = fgets($file);
fwrite($file,$line);
}
fclose($file);
?>
source
share