> 
> **Possible Duplicate:**  
> 
> [writing to a text file in php](https://stackoverflow.com/questions/1451590/writing-to-a-text-file-in-php) 
> 
> 
> 

Say I wanted to add the string $ip to the text file ip.txt in the same directory. I am currently using `file_get_contents` to read from the text file.