note 43447 added to function.file-get-contents
| From: | JordanBradford at rn2 dot php dot net | Date: | Mon, 21 Jun 2004 21:45:34 +0000 |
| Subject: | note 43447 added to function.file-get-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-71463@lists.php.net to get a copy of this message | ||
I found this EXTREMELY helpful tip on the doc page for mail():
> hnjunk at stltntt dot org
> 25-Feb-2004 09:01
> In response to:
> > Hubert Ley <hley at anl dot gov>
> > 30-Jan-2004 11:08
> > The previous two examples for attaching files to a message
> > have a significant flaw that shows up when attaching
> > binary files (e.g. zipped or gzipped files).
> ...
> > versions seem to have a function "file_get_contents" that
> > seems to do the right thing, but I am unable to verify this.
>
> I use <?php $data = chunk_split(base64_encode(implode("", file($file)))); ?>
> and it works fine for text, binary, and zipped files. file_get_contents(), on the other hand, seems
> to create faulty stream.
----
Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43447
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43447&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43447&report=yes
Search -- http://master.php.net/manage/user-notes.php