<?php
//九九乘法表
for($i=1;$i<10;$i++){
for($j=1;$j<=$i;$j++){
echo $j."*".$i."=".$j*$i." ";
}
echo "<br>";
}
//表格生成器
echo <<< 'INPUT'
<form>
请输入表格的行:<input type="text" name="row">列:<input type="text" name="col">
<button>提交</button>
</form>
INPUT;
$row = $_GET['row'];
$col = $_GET['col'];
echo '<table border="1" cellpadding="3" cellspacing="0" width="300">';
for ($i=0;$i<$row;$i++) {
echo '<tr>';
for ($j=0;$j<$col;$j++){
echo '<td>'.($i*$col+$j).'</td>';
}
echo '</te>';
}
echo '</table>';
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!