Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 1
    lot easier to just use file_put_contents('ip-address.txt', $data, FILE_APPEND) Commented Jul 17, 2014 at 20:32
  • So, if I replace the "w" with "a+" it will create another line in the txt file and log the next ip...? Instead of It rewriting the file every time and only keeping one ip at a time. Commented Jul 17, 2014 at 20:34
  • yes, I personally would follow @Marc B's advice, however. Commented Jul 17, 2014 at 20:34
  • dustin look at the fopen documentation Commented Jul 17, 2014 at 20:34
  • @DustinAngeletti: php.net/fopen just go read the docs. they CLEARLY explain what all the options do. Commented Jul 17, 2014 at 20:36