★ wanayoo — archive 1999 http://www.php.net/manual/ja/function.feof.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to ファイルシステム
Quick Reference
English version of this pageGerman version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
ファイルシステム
* basename
* chgrp
* chmod
* chown
* clearstatcache
* copy
* delete
* dirname
* diskfreespace
* fclose
* feof
* fgetc
* fgetcsv
* fgets
* fgetss
* file
* file_exists
* fileatime
* filectime
* filegroup
* fileinode
* filemtime
* fileowner
* fileperms
* filesize
* filetype
* flock
* fopen
* fpassthru
* fputs
* fread
* fscanf
* fseek
* fstat
* ftell
* ftruncate
* fwrite
* set_file_buffer
* is_dir
* is_executable
* is_file
* is_link
* is_readable
* is_writeable
* link
* linkinfo
* mkdir
* pclose
* popen
* readfile
* readlink
* rename
* rewind
* rmdir
* stat
* lstat
* realpath
* symlink
* tempnam
* touch
* umask
* unlink
Manual: feof
View the source code for this pageSearch the site



Previous page
 fclose
 Updated
Sat, 12 Aug 2000
fgetc 
Next page


feof

(PHP3 , PHP4 )

feof -- ファイルポインタがファイル終端に達しているかどうか調べる

説明

int feof (int fp)

ファイルポインタがEOFに達しているかエラーの場合にtrue、 その他の場合にfalseを返します。

ファイルポインタは有効なものでなければならず、また fopen()またはfsockopen() で正常にオープンされたファイルを指している必要があります。


User Contributed Notes: feof


matt@ewtoo.org
24-Feb-2000 09:33
I use this to read from a file (actually a web page):

<PRE>
while(!feof($fp)) {
$content .= fgetc($fp); //by char
}
</PRE>

Afterwards, my <TT>$content</TT> variable has the last character of ASCII 255 (y with tilde).

Any ideas how I can get rid of this?



matt@ewtoo.org
28-Feb-2000 11:49
I resorted to using <PRE>feof($fp)</PRE> with <PRE>fgets($fp, 4096)</PRE> instead, which doesn't suffer from the EOF character error.


rtroxell@gdats.com
10-Mar-2000 04:06
I am using while (!feof) and it enters the loop AFTER it encounters an TRUE condition. I am creating Oracle insert statements, and the last statement I parse has empty data because logically it is at the end of the file.

Is this a bug? Anyone know a fix?



d99rg@efd.lth.se
01-Aug-2000 02:48
A web server closes the connection after it has sent the data, therefore feof() returns false. But when connected to a telnet server, how can you check that the server has sent its reply?
I've tried a while loop but the script just hangs without any output, even though i flush after every line read from the socket.



 About Notes


Previous page
 fclose
 Updated
Sat, 12 Aug 2000
fgetc 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.