Sat, July 11, 2020, 02:01:35
 
Home · Latest · Trends  /  PHP
3

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 3 times [  3] [ 0]  / comments: 0 / hits: 208  / 4 months ago, sun, mar 8, 2020, 06:58:05
More From » PHP
 

Comments

There are no comments for this Snippet yet
Username
 
Your Comment
 
Share
Snippets
4 months 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.