You are here: Re: Fopen() error: can anybody help? « All PHP « IT news, forums, messages
Re: Fopen() error: can anybody help?

Posted by Steve on 10/06/06 19:50

<mypipeline@googlemail.com> wrote in message
news:1160160830.745257.173080@h48g2000cwc.googlegroups.com...
| Sorry but I'm quite new to Php programming. I've written a short simple
| script that tries to look for patterns in a long txt file:
|
| $quotestxt = "$DOCUMENT_ROOT/quotes.txt";
| $quotes_file = fopen($quotestxt, 'r+');
| while (fread($quotes_file, 1024)) {
| $pattern = '^[\"]';
| $quote_roster = preg_match($pattern, $quotes_file);
| print_r($quote_roster);
| }
|
| however I get the error message
| Parse error: parse error, unexpected T_VARIABLE in line:
| $quotestxt = "$DOCUMENT_ROOT/quotes.txt";
|
| i've been to the manual but can't find what i'm looking for. can anyone
| help?
|
| Pipes


well, you left out the line number in the error message. it is safe to
assume that any time you get the T_VARIABLE parse error, you should find the
line number that the error specifies. then, look at the previous lines
(usually the one immediately above) until you see a line of code not ended
with either a ; but some times (rarely) a missing } or php tag (?>).

hth.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация