只想让这个显示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 "
暂无记录
";
}
------解决方案--------------------