只想让这个显示8个。不想全部显示。请帮写完整,多谢
程序员文章站
2022-05-16 16:52:09
...
只想让这个显示8个。不想全部显示。请帮写完整,谢谢
foreach ($history as $val){
echo "".$val[3]."
";
}
}else{
echo "
}
?>
------解决方案--------------------
foreach (array_slice($history, 0, 8) as $val)
------解决方案--------------------
if ($history){
foreach (array_slice($history, 0, 8) as $val){
echo "".$val[3]."
";
}
}else{
echo "
}
------解决方案--------------------
foreach ($history as $val){
echo "".$val[3]."
";
}
}else{
echo "
暂无记录
";}
?>
------解决方案--------------------
foreach (array_slice($history, 0, 8) as $val)
------解决方案--------------------
if ($history){
foreach (array_slice($history, 0, 8) as $val){
echo "".$val[3]."
";
}
}else{
echo "
暂无记录
";}
------解决方案--------------------
相关文章
相关视频