Re: parse error on fgets

From: Date: Wed, 05 May 2004 09:35:10 +0000
Subject: Re: parse error on fgets
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-185403@lists.php.net to get a copy of this message
dburch@oz.net wrote:
Using PHP 4 with this code: if ($csvfile = fopen($csvpath, "r")) {
     while (!feof ($csvfile))
      {
        $filestring = fgets( $csvfile , 255);
      }
} I get a parse error on the line : $filestring = fgets( $csvfile , 255); Any ideas why this is happening? replacing it with fread also returns a parse error. Please reply to me directly as the digest takes awhile to get to me.
I don't get a parse error making a new document just with your code (I did get an "Undefined variable $cvspath" - but that's only a NOTICE, and obviously not the problem you describe). Are you certain you don't have an error above/below this code snip (maybe missing a trailing curly bracket somewhere)? -brian

« previous php.general (#185403) next »