#24059 [Csd->Bgs]: fputs($datei,"\n"); don't go in a new line

From: Date: Sat, 07 Jun 2003 09:46:55 +0000
Subject: #24059 [Csd->Bgs]: fputs($datei,"\n"); don't go in a new line
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-41429@lists.php.net to get a copy of this message
ID: 24059 Updated by: sniper@php.net Reported By: michael dot hofinger at utanet dot at -Status: Closed +Status: Bogus Bug Type: Filesystem function related Operating System: Windows XP SP1 German PHP Version: 4.3.2 New Comment: Not bug -> bogus. Previous Comments: ------------------------------------------------------------------------ [2003-06-07 04:42:39] michael dot hofinger at utanet dot at It works. :-) Thank you for your help!! ------------------------------------------------------------------------ [2003-06-06 09:57:32] wez@php.net Starting with PHP 4.3.2, the default mode for all fopen()d files is binary mode to match CLI and CGI versions of PHP, and also the default behaviour of PHP on other platforms. You can use the 't' mode to explicitly open files in text mode like this: $datei = fopen($dateiname, 'at'); ------------------------------------------------------------------------ [2003-06-06 08:40:32] michael dot hofinger at utanet dot at example: <?php $dateiname = "clients.txt"; $datei=fopen($dateiname,"a"); fputs($datei,"hello"); fputs($datei,"\t"); // tab OK! fputs($datei,"test"); fputs($datei,"\n"); // new line NOT OK! fputs($datei,"hello"); fclose($datei); ?> the script work with PHP 4.3.0 without problems! (i use the php.ini from php 4.3.0 although in 4.3.2) Apache 1.3.27 php as module mfg Mike ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24059&edit=1

« previous php.bugs (#41429) next »