You are here: Re: file() doesn't work « PHP Programming Language « IT news, forums, messages
Re: file() doesn't work

Posted by Dave Moore on 12/29/05 00:36

Thanks. That seems to be working now.

Ta,
Dave

"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:43b2f5f2$0$62369$dbd4f001@news.euronet.nl...
> Dave Moore wrote:
> > Hi All,
> > Ok, here's my problem. I want to open a file and process its
> > contents. However, because it is possible that the file may not
> > exist, I also want to check whether the file() function is successful
> > before attempting to process any returned data from the file()
> > function. The php file() manual page suggests that it returns FALSE
> > if it is unsuccessful, however this simply doesn't happen on my
> > system. My code looks like the following:
> >
> >
>
> It does work as is demonstrated with the following:
>
> print file('http://example.com/lost') == false ? 1 : 0;
>
> Have a look at what the file() function call actually returns (e.g., with
> print_r()). Chances are that because of some directive, your webserver
does
> not return a 404 response code, but redirects with a 301/302 response code
> to some other page.
>
>
> JW
>
>

 

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

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