RE: [PHP] File_get_contents()
| From: | Jeff McKeon | Date: | Thu, 07 Apr 2005 12:21:23 +0000 |
| Subject: | RE: [PHP] File_get_contents() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-212529@lists.php.net to get a copy of this message | ||
>
> > -----Original Message-----
> > From: Jeff McKeon [mailto:jmckeon@telaurus.com]
> > Sent: 7 April 2005 1:03 pm
> > To: php-general@lists.php.net
> > Subject: [PHP] File_get_contents()
> >
> >
> > Does anyone know if it's possible to have
> file_get_contents() accept a
> > file handle?
> >
> > $handle=fopen("/tmp/file","r");
> > file_get_contents($handle);
> >
> > This doesn't seem to work for me, it generates an error about first
> > parameter needing to be a string.
> >
> > I've tried:
> >
> > file_get_contents('{$handle}');
> >
> > But that doesn't work either...
> >
> > Thanks,
> >
> > jeff
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> -----Original Message-----
> From: George Pitcher [mailto:george.pitcher@ingenta.com]
> Sent: Thursday, April 07, 2005 7:17 AM
> To: Jeff McKeon
> Subject: RE: [PHP] File_get_contents()
>
>
> Jeff,
>
> Do you need to give it a handle? You can just point
> 'file_get_contents' to the file, unopened.
>
> eg: file_get_contents("/tmp/file");
>
> 'file_get_contents' can only read the contents so there's no
> requirement to set a 'read' option.
>
> George
>
Sorry,
What I'm actually doing is this.
$handle=fopen("php//stdin/","r");
file_get_contents($handle);
I should have put that in the original post, my bad.
Now that I look at it, does anyone think this would work...
file_get_contents("php//stdin/");