RE: [PHP] Getting the contents of a file
| From: | Ford, Mike | Date: | Thu, 25 Nov 2004 10:33:52 +0000 |
| Subject: | RE: [PHP] Getting the contents of a file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-202838@lists.php.net to get a copy of this message | ||
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
On 25 November 2004 10:11, Octavian Rasnita wrote:
> Hi all,
>
> I am trying to use the file() function, but without success.
>
> Here is the code:
> $url = "http://www.rasd.ro/Quotes/11-24-2004.txt"
You have no semicolon on the end of the above line.
> $file = file($url);
So the $file at the beginning of this line is a parse error.
> And this is the error:
> PHP Parse error: syntax error, unexpected T_VARIABLE in [FILE] on
> line 13
PHP can only tell you the line on which it first detects an error (13, in
this case); the actual error may be on a previous line (12, in this case).
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211