Fri, April 10, 2020, 13:08:15
 
Home · Latest · Trends  /  PHP
2

fwrite - Write new line in text file

<?php
$ip = $_SERVER['REMOTE_ADDR'];
$ip = $ip . PHP_EOL;
$file = "text.txt";
$fh = fopen($file, 'a');
fwrite($fh, $ip);
fclose($fh);
?>
rated 2 times [  2] [ 0]  / comments: 0 / hits: 56  / 1 month ago, sun, mar 8, 2020, 06:58:05
More From » PHP
 

Comments

There are no comments for this Snippet yet
Username
 
Your Comment
 
Share
Sponsor
Sponsor
Snippets
1 month ago, tue, mar 10, 2020
Posted
suppe

suppe

Member since Feb 16, 2020
Total Code Snippets: 2
Total Comments: 1
Location: n/a
Following
User not following anyone yet.