Yea, I realized (that's what the EDIT was for)
Changed things round to this and I am now having a slightly different (by no means fatal) problem.
Here is the code
<?php
$buffer='';
for($i=0;$i<count($readfile);$i++) {
$readfile[$i]=str_replace("\n",'',$readfile[$i]);
echo("\t".$i." : ".$readfile[$i]."\n");
if(is_file($readfile[$i])) {
if(is_readable($readfile[$i])) {
if(!$fp=fopen($readfile[$i],'r')) {
exit("\tCould not open file\n");
}
$filesize=filesize($readfile[$i]);
echo("\tSize : ".$filesize."\n");
$div=(int)($filesize/100)+(($filesize%10==0)?0:1);
if($div==0)
$div=1;
echo("\t");
while(!feof($fp)) {
echo("*");
$buffer.=fread($fp,$div);
}
fclose($fp);
echo("\n");
for($j=0;$j<10000;$j++) {}
if(preg_match("/^".str_replace('/','\/',$file)."$/",$buffer)) {
echo("\nMATCHER!!!!\n");
return $readfile[$i];
}
$buffer='';
} else {
echo("\tNot Readable ... get root!\n");
}
} else {
echo("\tWas not a file\n");
}
}
?>
An the area I am having a poblem with is this
<?php
$filesize=filesize($readfile[$i]);
echo("\tSize : ".$filesize."\n");
$div=(int)($filesize/100)+(($filesize%10==0)?0:1);
if($div==0)
$div=1;
echo("\t");
while(!feof($fp)) {
echo("*");
$buffer.=fread($fp,$div);
}
fclose($fp);
?>
Now, by my reconing that should print 100 s for each file unless it is less that 100 bytes long and the it hould show less. The aim, as I'm sure you can guess is to show me the progress through the files. However, a strange thing I am noticing is that for some files I am getting more than 100 s, somtimes about 150!
I can't explain it. Also is there a commant to make php wait for a given amount of time before it continues?
Thanks
Bubble