foreach($posts as $post)
{
$words = preg_split("/\|/", $post);
$author = trim($words[0]) . ' ' . trim($words[1]);
$title = trim($words[2]);
$comment = trim($words[3]);
$priority = trim($words[4]);
$filename = trim($words[5]);
$postedTime = $words[6];
我将.txt文件传递给html表单,该文件缺少一些我不应该显示的信息。在读取它时,我在$ postedTime上得到一个未定义的偏移量6,该文件缺少该值。任何想法如何避免消息?
答案 0 :(得分:0)
要避免消息您可以执行以下操作:
.container-wrapper {
display: flex;
}
.container {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.scroll {
flex-grow: 1;
}
答案 1 :(得分:0)
试试这个:
$postedTime = (isset($words[6]))?$words[6]:'';