array
| From: | Chris Herring | Date: | Wed, 22 Aug 2001 06:04:21 +0000 |
| Subject: | array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-63857@lists.php.net to get a copy of this message | ||
I'm trying to get an array to read the text from a file, and so far it isn't working. If
you can help me, respond.
<snippet>
$fp = fopen ("./file.txt", "r");
$text = array ($fp);
sort ($text);
reset ($text);
while (list ($key, $val) = each ($text)) {
echo "[".$key."] ".$val;
echo "<br>";
}
fclose ($fp);
</snippet>
Currently all that does is print out "[0] Resource id #1"
Any help is GREATLY appreciated. Thanks in advance.