当前位置:Gxlcms > PHP教程 > 急php页面加载不完全的有关问题

急php页面加载不完全的有关问题

时间:2021-07-01 10:21:17 帮助过:13人阅读

急!!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);
?>