Wed, April 14, 2021
 
https://devcodepro.comdevcodepro
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: 724  / 1 year 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
 
Share
Posted
suppe
Member since Feb 16, 2020
Total Code Snippets: 5
Total Comments: 2
Location: New Britain, Connecticut
suppe snippets
1 year ago, tue, mar 10, 20, 4:06:17
comments: 0 / hits: 542
8 months ago, sun, sep 6, 20, 10:58:41
comments: 0 / hits: 239
7 months ago, sun, sep 27, 20, 5:47:13
comments: 0 / hits: 213
7 months ago, mon, oct 12, 20, 1:27:34
comments: 0 / hits: 172