Line break problem
$fp = fopen ("Log.txt", "a");
Fwrite ($fp, Date ("y-m-d h:i:s"));
Fwrite ($FP, "");
Fwrite ($FP, $_server[remote_addr]);
Fwrite ($FP, "");
Fwrite ($FP, $_server[http_x_rewrite_url]);
Fwrite ($FP, "");
Fwrite ($FP, $_server[http_user_agent]);
Fwrite ($FP, "");
Fwrite ($fp, $_server["Http_referer"]);
Fwrite ($FP, "");
Fclose ($FP);
?>
This is the record of the visitor's IP. How to let write in txt inside the line, this is displayed on a line
------Solution--------------------
Add a newline character to each line where you want to break it.
Fwrite ($fp, "\t\r\n");
------Solution--------------------
PHP Code
$fp = fopen ("Log.txt", "a"), Fwrite ($fp, Date ("Y-m-d h:i:s"). PHP_EOL); Use Php_eol to change the line, cross-platform
------Solution--------------------
Php. Both EOL and \ n are fine.
------Solution--------------------
Fwrite ($FP, "");
Switch
Fwrite ($fp, Php_eol);