perl-like "slurp" in PHP?

From: gm (me_at_here.com)
Date: 12/23/04


Date: Wed, 22 Dec 2004 22:46:20 -0500

There is a module for perl called "slurp" which (from the documentation)
'serves one purpose - to provide a simple means to read (or slurp) an
entire file into memory for processing. This module allows the
replacement of the prototypical foreach- or while- loops used for
opening and reading of files with single-line constructs.'

In its simplest use, it can read a file (everything in unix is a "file"
of strings, webpages, socket output, everything) into an array, one line
at a time into one array element.

I often use it to suck an entire webpage into an array and iterate
through the contents while in memory. I've seen routines to suck a file
into a string, so something similar will probably work for an array but
does anyone know if there's a function or class for PHP that already
does this?