Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #32873 : file_get_contents appends \n
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 25th March 20:08
External User
 
Posts: 1
Default #32873 : file_get_contents appends \n


ID: 32873
Updated by: derick@php.net
Reported By: mbm at interflow dot dk
-Status: Open
+Status: Bogus
Bug Type: Filesystem function related
Operating System: FreeBSD 5.2
PHP Version: 5.0.3
New Comment:

The echo shell command does this by default.
Use "echo -n" to prevent it.


Previous Comments:
------------------------------------------------------------------------

[2005-04-28 20:17:06] mbm at interflow dot dk

Description:
------------
When loading a file with file_get_contents theres an \n appended to the
content.

Reproduce code:
---------------
echo "foo" > file.txt
php -r 'var_dump(file_get_contents("file.txt"));'

Expected result:
----------------
string(3) "foo"


Actual result:
--------------
string(4) "foo
"


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=32873&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666