仅当我使用explode语句处理文件时才会出现未定义的偏移量错误,它表示由explode语句创建的数组是未定义的,但是当我按照注释行中的代码处理正常的explode语句时则不是我可以在了解这一点上获得帮助吗?>
<?php
$file = "../hai/jobs.txt";
if (file_exists($file))
{
$handle = fopen ($file,"r");
if (!empty($file))
{
while (!feof($handle))
{
$curLine = fgets($handle);
if ($curLine != "")
{
$line = explode ("\t",$curLine);
echo $line[1];
//$a = "hai,how,are,you,going";
//$array = explode (",",$a);
//echo $array[1];
}
}
}
fclose($handle);
}
?>
</body>
</html>
仅当我使用explode语句处理文件时才出现未定义的偏移量错误,它表示由explode语句创建的数组是未定义的,但是当我按照...]处理普通的explode语句时则未定义。 [
\t
(制表符)?如果使用与注释示例中相同的文本,则可能需要切换为逗号,
。