ID:               9441
 Updated by:       paj...@php.net
 Reported By:      php at leon dot brooks dot fdns dot net
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: (all, using) Linux 2.2.18
 PHP Version:      4.0.4pl1
 New Comment:

Use file()


Previous Comments:
------------------------------------------------------------------------

[2002-08-02 09:21:50] parham_m_s at hotmail dot com

i recently converted from perl to php and this was the first thing i
realized.  The foreach construct should be implemented into files
because it's just eyepleasing (and easier) for some people.  The same
idea should also be applied to opendir (or even dumping an entire
directory tree into an array).

------------------------------------------------------------------------

[2001-02-25 09:02:14] php at leon dot brooks dot fdns dot net

Would find it convenient to do this:

$filehandle=fopen("file","r");
foreach ($filehandle as $line) {
    # process line (line ends stripped off)
}
fclose ($filehandle);

...and even this...

$filehandle=fopen("file","r");
foreach ($filehandle as $line[]) {
    # $line[0] = whole line sans ends
    # $line[1] = first word (exploded out gawk-like)
    # $line[2] = second word, etc
}
fclose ($filehandle);

...just a thought.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=9441&edit=1

Reply via email to