for($i=0;$i<=2;$i++){
$filename = "accounts/".$_SESSION['login']."/character".$i".txt";
if(file_exists($filename)){
$file = fopen($filename, 'r');
$characterFile = fread($file, filesize($filename));
$characterLines = explode("\n", $characterFile);
fclose($file);
}
}
I've tried the following and some variants but none will work:
for($i=0;$i<=2;$i++){
$filename = "accounts/".$_SESSION['login']."/character".$i".txt";
if(file_exists($filename)){
$file = fopen($filename, 'r');
$characterFile[COLOR="Red"].$i[/COLOR] = fread($file, filesize($filename));
$characterLines[COLOR="Red"].$i[/COLOR] = explode("\n", $characterFile[COLOR="Red"].$i[/COLOR]);
fclose($file);
}
}
The result I'm trying to obtain is something like:
$characterLines0 = ["file0line0","file0line1","file0line2"];
$characterLines1 = ["file1line0","file1line1","file1line2"];
$characterLines2 = ["file2line0","file2line1","file2line2"];
I'd validate stuff in a similar manner I believe but I'm lost so any suggestions would be appreciated :)
Edited by by0logic, 21 November 2010 - 12:55 PM.


Sign In
Create Account


Back to top









