trying to upload a text file and parse it.
file is just over 2mb in size. i run the code on my local apache/php server(windows based) and it runs fine. but i run the same code on my linux box and it hangs up the browser.
any suggestions on what to look at here:
text file sample:
10 10 6.79
100 3 7.99
10004 0 6.79
10005 31 17.99
10006 0 4.1
10007 19 11.99
10014 0 7.25
10015 9 19.99
10016 0 6.79
10017 0 7.19
10020 0 7.19
10025 3 6.99
10026 0 6.79
10027 2 10.99
10028 0 15.99
1003 0 12.99
10030 0 6.79
10031 23 20.99
10036 5 6.99
10037 0 17.99
10038 5 17.99
code:
function importfile($fileName,$explodeDelimiter)
{
$lines = file($fileName);
foreach ($lines as $line_num => $line) {
//echo $line;
//this seems to be where the hangup is happening as i tested by commenting this out and running it... worked okay then
$lineArr = explode($explodeDelimiter,$line);
echo "Line #<b>{$line_num}</b><br />";
foreach($lineArr as $newString_num =>$newString){
echo "[".$newString_num."] ".$newString."<br />";
}
echo "<br />";
}
echo "<br /><br />";
}
$filename = uploadFile($path,$_FILES['fileToParse']['tmp_name'],"fileToParse");
$newPath = "datafeedImport/".$filename;
importfile($newPath," ");
again, this code was working fine on my local server.
as always, thanks very much for any help.