Well for start you should include "r"
$myfile = file("fail.txt","r");
use end(array) to get your last element
and id take a look at this
$failiridu is an integer so this is what you are doing
mystring[4-0]);
mystring[4-1]);
mystring[4-2]);
$mystring[$failiridu-$i]);
This doesn't seem very logical i would try and find a better way, just my thoughts though
Mark
hdwt.com