|
|
|
PHP จะกำหนดการวนลูป for กับ Multiple Rows Column มาผสมกันอย่างงัยดีครับ |
|
|
|
|
|
|
|
Code (PHP)
<?
echo"<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\"><tr>";
$intRows = 0;
for($i=1;$i<=10;$i++)
{
echo "<td>";
$intRows++;
?>
<center>
<img src="thaicreate/<?=$objResult["Picture"];?>"><br>
<?=$objResult["GalleryName"];?>
<br>
</center>
<?
echo"</td>";
if(($intRows)%2==0)
{
echo"</tr>";
}
}
echo"</tr></table>";
?>
|
|
|
|
|
Date :
2012-09-07 21:08:20 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$array = range(1,100);
$table = array_chunk($array, 10);
echo '<table border="1">';
array_walk($table,function($row){
echo '<tr>';
array_walk($row,function($col){
echo '<td>',$col,'</td>';
});
echo '</tr>';
});
echo '</table>';
|
|
|
|
|
Date :
2012-09-07 23:45:09 |
By :
num |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณครับ
|
|
|
|
|
Date :
2012-09-08 08:31:30 |
By :
satonpanit |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|