<?phpforeach ($xg as $key => $value){?><li><?php echo $value?></li><?php}?>
如果$xg 是从0索引连续的,可以这样:
<?phpforeach ($xg as $key => $value){?><li><?php echo ($key+1). $value?></li><?php}?>
$i = 0;
foreach ($xg as $key => $value){
$i++;
?>
<?phpforeach ($xg as $key => $value){?><li><?php echo $value?></li><?php}?>
<?phpforeach ($xg as $key => $value){?><li><?php echo $value?></li><?php}?>
可以用html的ol有序标签,
<?phpforeach ($xg as $key => $value){?><li><?php echo $value?></li><?php}?>
<?phpforeach ($xg as $key => $value){?><li><?php echo $value?></li><?php}?>
3楼的代码简洁啊,哈~~~