note 74812 added to function.fwrite
| From: | blasta at neostrada dot pl | Date: | Sat, 28 Apr 2007 08:03:31 +0000 |
| Subject: | note 74812 added to function.fwrite | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125941@lists.php.net to get a copy of this message | ||
Hi, I've found weird behaviour in fwrite
I was trying to do :
<?php
$myString = 'My simple text /n/n Second simple text';
fwrite($fh,$myString);
?>
And what happened ? In output file instead of line endings /n/n was written.
OUTPUT : My simple text /n/n Second simple text
After changing ' to " it worked so watch out.
<?php
$myString = "My simple text /n/n Second simple text";
fwrite($fh,$myString);
?>
OUTPUT : My simple text
Second simple text
----
Server IP: 195.136.184.34
Probable Submitter: 83.7.39.172
----
Manual Page -- http://www.php.net/manual/en/function.fwrite.php
Edit -- https://master.php.net/note/edit/74812
Del: integrated -- https://master.php.net/note/delete/74812/integrated
Del: useless -- https://master.php.net/note/delete/74812/useless
Del: bad code -- https://master.php.net/note/delete/74812/bad+code
Del: spam -- https://master.php.net/note/delete/74812/spam
Del: non-english -- https://master.php.net/note/delete/74812/non-english
Del: in docs -- https://master.php.net/note/delete/74812/in+docs
Del: other reasons-- https://master.php.net/note/delete/74812
Reject -- https://master.php.net/note/reject/74812
Search -- https://master.php.net/manage/user-notes.php