$robots = fopen("$path/robots.txt", "a+");
rewind($robots);
fgets($robots, 256);
fwrite($robots, "sitemap: http://www.mysite.com/sitemap_$pageNum.txt\n");
fclose($robots);
I'm trying to write a line after the first line in my robots.txt file.
This keeps appending the line at the end of the file. Why? I thought the rewind() would go back to the beginning of the file and fgets() would move to the next line.