I need to make an array in php that will output an html table so I can grab the source.
##id:1## ##site:1##
##id:2## ##site:2##
etc. 500 times over.
I need to make an array in php that will output an html table so I can grab the source.
##id:1## ##site:1##
##id:2## ##site:2##
etc. 500 times over.
<table>
<?
for($i = 0; $i < 500; ++$i) {
echo '<tr><td>',$i,'</td><td>',$i,'</td></tr>';
} ?>
</table>
people are really lazy these days …
i dont really know what u need that for but here is my solution (not tested)
$table_array=array(
{id}=>'{text}',
{id2}=>'{text2}'
);
echo '<table>';
foreach($id=>$row in $table_array){
echo '<tr id="'.$id.'">';
echo '<td>'.$row.'</td>';
echo '</tr>';
}
echo '</table>';
You just have to generate the Array with the right text and id, then it should work fine.