#18922 [NEW]: \r & \n & file()
| From: | phpinfo at 21cn dot com | Date: | Thu, 15 Aug 2002 18:15:19 +0000 |
| Subject: | #18922 [NEW]: \r & \n & file() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-16924@lists.php.net to get a copy of this message | ||
From: phpinfo@21cn.com
Operating system: Windows 2k
PHP version: 4.2.2
PHP Bug Type: Filesystem function related
Bug description: \r & \n & file()
I found some boring things when i use file() fgetc()
all my test was based windows and i configed my php
with the 'apache module' way .
1.
First i create a file named 'file.txt' with the Editplus,
and i type some charactors like:
s
s
s
s
s
s
my script is :
<?
$data=file('file.txt');
$wtmsg=implode(NULL,$data);
$fp=fopen('file.txt','w');
fwrite($fp,$wtmsg);
fclose($fp);
?>
after i refresh the page sometimes
the 'file.txt' is like :
s
s
s
s
s
the function file() add a lot of \r before \n
--
Edit bug report at http://bugs.php.net/?id=18922&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18922&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18922&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18922&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18922&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18922&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18922&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18922&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18922&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18922&r=globals