急!!php頁面載入不完全的問題,線上等
RT,同一個頁面多次重新整理,有時候正常,有時候只顯示一半,有時候則完全空白
完全的頁面
一半
本機調試的時候沒有遇到此問題,這是在外網發布的時候發生的。下拉框中的內容是用fopen開啟了一個.tab檔案然後讀取出來的,然後通過迴圈轉成數組,又通過迴圈給js數組賦值,迴圈為1000。
設定了set_time_limit(60*60*10)依然無效。。。
跪求指導,謝謝。。。附上部分代碼
common.php
public static function readTabFile($fileName)
{
if (!file_exists($fileName))
{
die("404 File not found!");
}
$handle = fopen($fileName, 'rb');
$contents = fread($handle, filesize ($fileName));
//iconv("UTF-8","GBK", $contents);
if(ord($contents) == 0xEF)
{
$contents = substr($contents, 4);
}
$rows = explode("\r\n", $contents);
fclose($handle);
$ret;
$colNames = null;
for($i = 0; $i < count($rows); $i++)
{
$row = $rows[$i];
if(!empty($row) && $row != "" && substr($row, 0, 1) != "#")
{
$col = explode("\t", $row);
if(empty($colNames) || $colNames == null)
$colNames = $col;
else
{
$item;
$itemId = (int)$col[0];
if(empty($itemId))
{
die("...");
}
for($j = 0; $j < count($col); $j++)
{
$value = $col[$j];
$item[$colNames[$j]] = $value;
}
$ret[$itemId] = $item;
}
}
}
return $ret;
}
?>
test.php
$dir = "../goods.tab";
$table = Common::readTabFile($dir);
?>