baska
asked on
reading file from a directory?
hai all,
I wanted to read a dir & choose a particular file.
I wrote as follows:
$dir=dir("/home/ftp/rf_aut o");
while($file=$dir->read()){
if(substr($file,14,8)=="rf _auto2" && (substr ($file,-12,8)==substr($fil ename,-12, 8))){
$fcontents1=$file;
exit();
}
in this loop I wanted to exit the loop once I select the file($file).
How do I do this?
Thank u,
baska
I wanted to read a dir & choose a particular file.
I wrote as follows:
$dir=dir("/home/ftp/rf_aut
while($file=$dir->read()){
if(substr($file,14,8)=="rf
$fcontents1=$file;
exit();
}
in this loop I wanted to exit the loop once I select the file($file).
How do I do this?
Thank u,
baska
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
}
//my requirement is,it should not read until end of the dir
//how to implement the condition.
thank u
baska