On Monday 07 May 2001 19:37, tk wrote:
> when i echo $buffer to the screen it prints out hte content of hte file
> line by line
> if i echo $photos[i] to the screen it just prints out random numbers
> and not the content i'd expect
>
> (the code i'm using to do this is:
>
> $i = 0;
>  while(!feof ($fp)){
>   $buffer = trim(fgets($fp, 4096));
>   echo $buffer."<br>";
>   $photos[i] = $buffer;
>   echo $photos[i]."<br>";
>   $i++;
>  }
>  fclose($fp);

for these two echos, the printed result should be absolutely identical. 
Check the HTML source of the generated page to be sure, create a minimal 
PHP file that only contains these lines (plus the fopen of course) to see 
if the problem persists in that simple case and if there still are 
differences report it as bug.

AH!
Got it. replace 
$photos[i]
with
$photos[$i]

Right now it interprets the i in the brackets as bareword, assumes a 
string is meant and thus interprets it as $photos ['i'].

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Error 032: Recursion error - see error 032

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to