Thu, October 21, 2021
 
https://devcodepro.comdevcodepro
X
Home · Latest · Trends
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: 1009  / 2 years ago, sun, mar 8, 20, 06:58:05
More From » PHP
 

Comments

There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account
Login with Google
 
Share
Posted
suppe
Member since Feb 16, 2020
Total Code Snippets: 5
Total Comments: 2
Location: New Britain, Connecticut
suppe snippets
2 years ago, tue, mar 10, 20, 4:06:17
comments: 0 / hits: 652
1 year ago, sun, sep 6, 20, 10:58:41
comments: 0 / hits: 343
1 year ago, sun, sep 27, 20, 5:47:13
comments: 0 / hits: 391
1 year ago, mon, oct 12, 20, 1:27:34
comments: 0 / hits: 314