What this code is s'posed to do is run through a text file, which is seperated by commas, explode a line, shift the first variable of the array off of it to be used as a filename, then write that file to the data directory.
However, instead it just dumps it all into one large text file in the data directory. Any suggestions?
$file = file("./backup/database.txt");
for($i = 0; $i <= (count($file) - 1);$i++)
{
$temp = $file[$i];
$temp = explode(",", $temp);
$fn = array_shift($temp);
$temp = implode("|", $temp);
$cf = fopen("./data/$fn.txt", "w");
fputs($cf, "$temp");
fclose($cf);
}
Thanks,
Aethaellyn