Home >Backend Development >PHP Tutorial >PHP code for traversing data table data and arranging the list horizontally_PHP tutorial

PHP code for traversing data table data and arranging the list horizontally_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-21 15:44:32945browse

Copy code The code is as follows:

$a = array (1,2,3,4,5 ,6,7,8,9,10,11);
$i = 0;
?>


< ?
foreach ($a as $k){
if($i%3==0) {//This indicates the number of columns that need to be arranged horizontally.
echo "< ;tr>";
}
echo "";//The data of this column is displayed here.
$i ++;
}
?>

",$k,"

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/320509.htmlTechArticleCopy the code as follows: ?php $a = array (1,2,3,4,5,6, 7,8,9,10,11); $i = 0; ? table border=1 tr ? foreach ($a as $k){ if($i%3==0) {//This indicates that horizontal orientation is required Number of columns to arrange. echo...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn