Now what's wrong with this?
| From: | Kyle Babich | Date: | Sat, 21 Jun 2003 22:59:31 +0000 |
| Subject: | Now what's wrong with this? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-152413@lists.php.net to get a copy of this message | ||
The following code obtains lists of files from two different directories and reverse numerically
sorts them. Then bellow it takes one file and dumps the contents into an array, which works fine.
The problem is where it takes the entire content of the matching file from the second directory and
tries to put it into $entry. It returns a parse error on line 67, which is the line I marked. What
should I do to fix this?
Thanks a lot to you guys by the way for help with all of my problems. I'm a 16 year-old trying
to create a weblog system using PHP (a new language to me) over summer vacation for fun.
<?php
$postInfo = opendir('postInfo');
while (false !== ($filename = readdir($postInfo))) {
$infoFiles[] = $filename;
}
closedir($postInfo);
rsort($infoFiles, SORT_NUMERIC);
array_splice($infoFiles, 0, 2);
$postEntries = opendir('postEntries');
while (false !== ($filename = readdir($postEntries))) {
$entriesFiles[] = $filename;
}
closedir($postEntries);
rsort($entriesFiles, SORT_NUMERIC);
array_splice($entriesFiles, 0, 2);
$curr = 0;
foreach ($infoFiles as $infoIndex) {
foreach ($entriesFiles as $entriesIndex) {
$infoRaw = file("postInfo/{$infoindex}");
$entryGet = fopen("postEntries/{$entriesIndex}", 'r');
$entry = fread($entryGet, filesize("postEntries/{$entriesIndex}"); //67,
line /w parse error
fclose($entryGet);
?>
--
Kyle