Getting the contents of a file
| From: | Octavian Rasnita | Date: | Thu, 25 Nov 2004 10:11:12 +0000 |
| Subject: | Getting the contents of a file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-202836@lists.php.net to get a copy of this message | ||
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"
$file = file($url);
And this is the error:
PHP Parse error: syntax error, unexpected T_VARIABLE in [FILE] on line 13
The line 13 contains:
$file = file($url);
I get the content of $url in a more complex way, so I cannot put the url to
that file directly in the function file().
Why it is not possible to use a var in file()?
Thanks.
Teddy