note 43447 deleted from function.file-get-contents by tomsommer

From: Date: Mon, 21 Jun 2004 22:48:33 +0000
Subject: note 43447 deleted from function.file-get-contents by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-71466@lists.php.net to get a copy of this message
Note Submitter: Jordan Bradford ---- 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.

« previous php.notes (#71466) next »