Bug #67218 [Opn->Nab]: fwrite row from an other file
| From: | johannes@php.net | Date: | Tue, 06 May 2014 15:42:36 +0000 |
| Subject: | Bug #67218 [Opn->Nab]: fwrite row from an other file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-185672@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67218&edit=1
ID: 67218
Updated by: johannes@php.net
Reported by: sebrsu at gmail dot com
Summary: fwrite row from an other file
-Status: Open
+Status: Not a bug
Type: Bug
Package: Unknown/Other Function
Operating System: Windows 7
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
See http://php.net/file and the reference to FILE_IGNORE_NEW_LINES
Previous Comments:
------------------------------------------------------------------------
[2014-05-06 14:55:32] sebrsu at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.echo
---
<?php
$file1 = "test.txt";
$file2 = fopen("out.inc","a");
$rows = file($file1);
foreach($rows as $key => $row)
{
echo $row;
$rowhtml = "<tr>".$row."</tr>";
fwrite($file2, $rowhtml);
} ;
fclose($file2);
What is the criteria of writing $rowhtml ? Random criteria ? How that it works the carriage return ?
Test script:
---------------
In file test.txt there is:
12345678
90abcdef
ghil
Function echo response:
12345678 90abcdef ghil
In file out.inc:
<tr>12345678
</tr><tr>90abcdef
</tr><tr>ghil
</tr>
Expected result:
----------------
In file out.inc:
<tr>12345678</tr>
<tr>90abcdef</tr>
<tr>ghil</tr>
Actual result:
--------------
In file out.inc:
<tr>12345678
</tr><tr>90abcdef
</tr><tr>ghil
</tr>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67218&edit=1